Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Patrick Rotsaert Subject: How to make DLLs in cygwin for MSVC and BCB Date: Wed, 22 Jun 2005 17:00:08 +0200 Lines: 40 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-IsSubscribed: yes 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 __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/