Re: How to generate the _imp_ prefix?

Joachim Wuttke <j.wuttke-97/[email protected]> Wed, 22 Jan 2020 17:41:52 +0100
Newsgroups gmane.comp.gnu.mingw.user
Message-ID <[email protected]>
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.

_______________________________________________
MinGW-Users mailing list
[email protected]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.osdn.me/mailman/listinfo/mingw-users
Also: mailto:[email protected]?subject=unsubscribe
smime.p7s (application/pkcs7-signature, 5.2 KB) - not displayed