-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 3/1/2011 08:19, Dock, Dion wrote: >> -----Original Message----- >> From: Jon [mailto:[email protected]] On Behalf Of JonY >> Sent: Monday, February 14, 2011 4:36 PM >> To: Dock, Dion >> Cc: [email protected] >> Subject: Re: [Mingw-w64-public] having trouble using WinSDK function >> >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On 2/15/2011 06:22, Dock, Dion wrote: >>> I've produced a library built with MinGW64 that can be compiled and linked >> by MinGW64. However, when someone tries to link it in a Cygwin >> environment, they get errors about a missing function: >>> >>> foo.o:foo.cpp:(.text+0xfa8): undefined reference to >> `__imp__MapFileAndCheckSumA@12' >>> >>> This function is supplied via the Windows Platform SDK in >> ImageHlp.lib/ImageHlp.dll. >>> >>> I've tried to statically bind in ImageHlp.lib but the symbol isn't there: >>> >>> x86_64-w64-mingw32-gcc.exe -c foo.cpp x86_64-w64-mingw32-nm.exe >> foo.o >>> | find "Map" >>> U __imp_MapFileAndCheckSumA >>> x86_64-w64-mingw32-gcc.exe -c foo.cpp -L \temp\mingw_64 -lImageHlp >>> x86_64-w64-mingw32-nm.exe foo.o | find "Map" >>> U __imp_MapFileAndCheckSumA >>> >>> Any thoughts on how I can build my library to resolve this dependency? >> Would creating an export library do the trick? >>> >>> thanks, >>> -Dion >>> >> >> Hi, >> >> there are several problems that may have occurred. >> >> 1. The user forgot to use -limagehlp to link, or link command is incorrect. >> >> 2. The user is using an ancient mingw/cygwin installation, recent Cygwin >> w32api and mingw-w64 libimagehlp.a comes with >> __imp__MapFileAndCheckSumA@12. >> >> 3. You tried to use static MSVC ImageHlp.lib. You can't use that if you are >> using dllimport, as evident from the __imp_ prefix. Furthermore, you should >> use the provided libimagehlp.a that comes with mingw-w64. >> >> I hope that helps, but its just educated guesses until more information is >> available. >> >> Some information about the exact user link command and details of the >> development environment would be nice. > > The last sentence from #3 held the clue. I thought the MapFileAndCheckSum > function was only supplied by Microsoft; I didn't realize MinGW-64 had its > own > library. I had my client use the libmimgagehlp.a from Cygnus and it worked. >
We don't actually have a custom implementation of MapFileAndCheckSum, its still from MS, the library is just telling the linker to load the function from the dll at runtime. Well, using the mingw-w64 library should work too. Of course, Cygnus versions will be 32bit only afaik, but glad that it finally worked out. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) iEYEARECAAYFAk1sUSMACgkQp56AKe10wHcS0wCeLxSy5+L5rQRympgi5DSA0VLq 8csAnRAd49JaNdNZe09RLGYWrutU+b78 =RSe8 -----END PGP SIGNATURE-----
0xED74C077.asc
Description: application/pgp-keys
------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
