-----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.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (MingW32)

iEYEARECAAYFAk1Zyl8ACgkQp56AKe10wHfQqgCeIl8dh5xTgRKWiYrZtmMcQoeL
3dsAn2MOG6uFrbjGn8pWweTVRygAfm07
=w+MP
-----END PGP SIGNATURE-----

Attachment: 0xED74C077.asc
Description: application/pgp-keys

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to