[Mingw-users] How to generate the _imp_ prefix?

Back to archive index
Sergio NNX sfhac****@hotma*****
Thu Jan 23 03:04:28 JST 2020


I presume it is a different project! [Animated GIF]

Where does 'mingw.exe' come from?
________________________________
From: MinGW-Users <mingw****@lists*****> on behalf of Joachim Wuttke <j.wut****@fz-ju*****>
Sent: Thursday, 23 January 2020 3:41 AM
To: mingw****@lists***** <mingw****@lists*****>
Subject: Re: [Mingw-users] How to generate the _imp_ prefix?

Problem solved thanks to discussion at https://stackoverflow.com/questions/59845249:
MinGW is not MinGW.
Instead of mingw.exe, I now use x86_64-w64-mingw32-gcc from http://www.msys2.org.
With this, dumpbin reports
     Symbol name  : foo
with no underscore, and VS succeeds in linking.

- Joachim

> MinGW shall compile a shared C library mylib that contains functions like
>
>    declspec(dllexport) int foo();
>
> The library shall be used in a C++ application under Visual Studio.
>
> To inspect the compilation outcome,
>
>    dumpbin /HEADERS mylib.lib
>
> prints one stance per exported function. The stance for the above function
> foo contains the line
>
>    Symbol name  : _foo
>
> So, MinGW does not generate the prefix _imp_. Expectedly, linking the
> dependent application fails because Visual Studio cannot find _imp_foo.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/mingw-users/attachments/20200122/8bf13608/attachment.html>


More information about the MinGW-Users mailing list
Back to archive index