This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[HELP] Loading Mingw32 built DLLs into an MSVC application


Hi everyone,

This message follows one I sent 10 days ago (I've had the time to do lots
of testing without reaching a solution).

I have been trying to build DLLs with Mingw32. Browsing through the
faq and different web sites, I have succeeded in building my relocatable
DLL with Mingw32.

Quickview on the Mingw32 built DLLs seems perfectly correct compared to 
quickview
on the same DLLs built with MSVC (there is more information in the 
Mingw32 DLL
and most noticeably the import and export sections which are only visible 
using
dumpbin on MSVC built DLLs but are visible using quickview on the Mingw32 
built
DLLs).

I can load my DLL into a small test application that contains just 
LoadLibrary
and GetProcAddress whether the test application is compiled with Mingw32 
or
MSVC. I tried both main and WinMain and both C and C++ compilation: 
everything
works fine with the small test application.

However, I can't seem to load the DLL into the final MSVC compiled 
application.
LoadLibrary returns NULL and GetLastError returns 0, 2 or 126...

The final MSVC application is a big project (more than 200000 lines of 
code) which
generates a 4 Mb application. I did some testing which gave me the 
following
information:

I added the test code right at the beginning of the application WinMain
     -> doesn't work

I removed everything else from the WinMain (left just my test code in 
there)
     -> doesn't work

I removed third party .obj and .lib files and the related source files
     -> doesn't work

I removed an optional MFC application module (a substancial amount of 
unused
.obj files are linked into the final application but no MFC or third party
code is linked in) leaving just Win32 application code
     -> doesn't work

I removed a matherr trap function we link in
     -> doesn't work

I removed everything else (except the WinMain with the test code and the 
resource
files)
     -> it works !

Therefore, I suppose the following:
     the problem is not due to my project options
     the problem is not due to resource files
     the problem is not due to the third party code we link in
     the problem is not due to the MFC code we link in

     the problem MAY be due to the size of the application (4 Mb)
     the problem MAY be that the DLL does not relocate correctly


Thanks for any ideas,
Gilles

----------------------------------------------------------------------
Gilles Depeyrot                    <mailto:Gilles.Depeyrot@wanadoo.fr>

               Those who can do, those who can't simulate !

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]