Mail Archives: cygwin/2005/06/22/11:08:00
Hi all,
I need to build a DLL in cygwin (I use a lot of POSIX functions), that I
can use in MSVC and Borland CBuilder apps.
There are a lot of docs on the web, but most of them seem to be
outdated. Anyway, none of the methods I found seam to work.
The DLL will have to be loaded dynamically, i.e. using the win api func.
LoadLibrary, so I do not need an import library.
What commands do I need to issue to build the dll correctly?
Here's some test code I use:
/* test.c */
#include <windows.h>
__declspec(dllexport) int __stdcall testfunc(char *a, char *b);
BOOL APIENTRY DllMain(HANDLE hModule, DWORD reason, LPVOID lpReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
int __stdcall testfunc(char *a, char *b)
{
strcpy(a, b);
return 0;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -