Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <37821CB3.96092D2C@niles.de> Date: Tue, 06 Jul 1999 17:11:47 +0200 From: Alexander Mader Organization: KAPP GmbH & Co KG X-Mailer: Mozilla 4.04 [en] (WinNT; I) MIME-Version: 1.0 To: Pontus Lidman CC: cygwin AT sourceware DOT cygnus DOT com, klaus AT niles DOT de Subject: Thanks: Solved: DLLs References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hallo, some days ago Pontus Lidman answered an email regarding DLLs. Following the hints given in this answer and elsewhere in the thread "variation on the .dll, .lib, .a theme (help!)" I was able to solve the following problem: Given an MS built application build a DLL loadable by this application using GNU tools. In this DLL call functions provided by the original application in a DLL built using MS tools. In other words the task was to build a DLL with a MS entry point, the suitable calling convention, and resolved symbols from the application's MS DLL. Following Pontus' hint I declared my funtions for export as __declspec(dllexport). This was not neccessary in MSVC -- something somewhere must be fixing this. So the declaration reads something like extern __declspec(dllexport) foo( < params > ) { < body > } Following the hints of Takayuki Tamura I prepared the application's MS DLLs to be linkable for my purposes. I produced an export definitions file from the according .lib and used this with dlltool to get a .a library. So for a pair MSNAME.LIB, MSNAME.DLL I had something like echo "EXPORTS" > msname.def nm --demangle --defined-only MSNAME.lib |sed -n 's/^.* T //p' >> .def dlltool --dllname MSNAME.DLL --def msname.def \ --output-lib libmsname.a Now I could take the Makefile.nocyg from the example "How to make JNI ..." provided by Mumit Khan at http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ added the appropiate -L and -lmsname and got a working DLL. Thank you very much. Alexander. -- Alexander Mader -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com