7

Is it possible to use a library compiled by visual studio in an application compiled by g++ (mingw) on Windows?

Jesse Vogt
  • 16,229
  • 16
  • 59
  • 72

3 Answers3

7
Martin B
  • 23,670
  • 6
  • 53
  • 72
  • You don't need an import lib if you load the DLL with LoadLibrary() or LoadLibraryEx(). – Rob K Jul 16 '09 at 18:33
  • 1
    Your links are 404 now. It would be preferable for the answer to cover the basics of what the links say , and offer the links as supporting reference. – M.M Sep 24 '18 at 01:20
2

Also see the discussion for question QT/mingw32 undefined reference errors… unable to link a .lib

Community
  • 1
  • 1
Jesse Vogt
  • 16,229
  • 16
  • 59
  • 72
0

From a technical standpoint, there isn't any reason you shouldn't be able to (it's all x86 after all). As for in practice, there are a number of tools for converting between library and object file formats. If you can find the correct one and deal with any naming, calling convention and structure layout differences (I don't know that you will or won't need to deal with any of that) you should be good.

BCS
  • 75,627
  • 68
  • 187
  • 294