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

Sergio NNX sfhac****@hotma*****
Wed Jan 22 18:53:37 JST 2020

Let's assume we have the import library and we want to test/link it from VS.
Let's say I have: liblmfit.a, liblmfit.dll.a and lmfit.dll files and I would like my (VS) code/program to link to this import library.
Can you provide some code snippet to demonstrate to concept or process?

> Shall we tweak MingGW to generate _imp_foo, or VS to expect _foo?
How familiar are you with VS?

From: MinGW-Users <mingw****@lists*****> on behalf of Joachim Wuttke <j.wut****@fz-ju*****>
Sent: Wednesday, 22 January 2020 8:25 PM
To: MinGW Users List <mingw****@lists*****>
Subject: Re: [Mingw-users] How to generate the _imp_ prefix?

Thanks for your three mails, Sergio.

   The difficulty is not in building the dependent library under MinGW.
   The difficulty is to link the resulting import library from VS.

   As for my level of experience with MinGW: Zero.

   As for the "plenty of online tutorials", I would be most grateful
   for a link to a really pertinent one.

Back to the problem:

   For a function foo(),
   MinGW generates link symbol _foo (according to dumpbin libmylib.lib)
   whereas VS expects _imp_foo.

Hence the primordial question:

   Shall we tweak MingGW to generate _imp_foo, or VS to expect _foo?


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

More information about the MinGW-Users mailing list