This is the mail archive of the
cygwin
mailing list for the Cygwin project.
How to make DLLs in cygwin for MSVC and BCB
- From: Patrick Rotsaert <patrick dot rotsaert at tts-online dot be>
- To: cygwin at cygwin dot com
- Date: Wed, 22 Jun 2005 17:00:08 +0200
- Subject: How to make DLLs in cygwin for MSVC and BCB
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/