Re: How to generate the _imp_ prefix?
Eli Zaretskii <eliz-mXXj517/[email protected]> Tue, 21 Jan 2020 20:02:30 +0200
| Newsgroups | gmane.comp.gnu.mingw.user |
|---|---|
| Message-ID | <[email protected]> |
[Please keep the discussion on the list.] > From: Joachim Wuttke <[email protected]> > Date: Tue, 21 Jan 2020 18:09:37 +0100 > > > Isn't the __imp__ prefix supposed to be in the import library, not in > > the shared library (a.k.a. "DLL")? And if mylib.lib _is_ an import > > library, then how did you build it, exactly, i.e. with what MinGW > > commands? > > Yes, mylib.lib is supposed to be an import library. This is where > VS searches for symbols at link time. Until linking succeeds, > I am not concerned about the DLL. > > The mylib project has tests that are linked with mylib.lib, and > executed using mylib.dll. Works under MinGW. So the problem is > with cross-compilation. > > Compilation is under control of gitlab-runner and CMake. The > decisive line in .gitlab-ci.yml is > > - cmake -G "Ninja" -DLIB_MAN=OFF -DCMAKE_INSTALL_PREFIX=C:\opt\x64 -B. -DCMAKE_GNUtoMS=ON .. Ouch, Cmake! Who knows what it does under the hood? Did you configure it correctly for MinGW, at least? Perhaps ask it to display all the commands verbosely and see what it actually does? Anyway, the way I usually produce import libraries is via the "-Wl,--out-implib=" switch to GCC on the link command line. That produces import libraries with the __imp__ prefixes, so this stuff does work and the produced libraries should be usable with MSVC (although I never tried). _______________________________________________ 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