From: W DOT Derks AT nl DOT cis DOT philips DOT com ("wiljan") Subject: Now I know what went wrong when building dll's 13 Dec 1996 12:31:29 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199612131803.TAA02605.cygnus.gnu-win32@nl.cis.philips.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Original-To: X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 Original-Sender: owner-gnu-win32 AT cygnus DOT com I now finally can build dlls the way I want them. It turns out that I tried to link a dll without having a module which contains the line: asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0"); I am linking my dll not against cygwin, but against crtdll as they do in the minimalist gnu win32 environment. I had no use for crt0.o so I did not include it when linking. This causes the import table of the dll to be currupt, or simply not finished properly. Here some lines that are in the end of crt0.c: #ifdef __GNUC__ /* * This section terminates the list of imports under GCC. If you do not * include this then you will have problems when linking with DLLs. */ asm (".section .idata$3\n" ".long 0,0,0,0,0,0,0,0"); #endif This explains why one gets currupted dlls which are not loadable. It whould be nice if one whould get a message for ld indicating that this is the case. I am now able to link code together using just the cygnus tools and call the dll again from Visual Basic. This means that NOTHING IS WRONG with LD and DLLTOOL Thus wehn linking asure that one for your modules contains above line. Is this documented somewhere ??? Greetings, Wiljan - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".