2

Is it possible to use a static library that was compiled with mingw in a visual studio MSVC project? Both projects are C++. I haven't found a clear answer on that. Note that I'm talking about a static library and not a DLL.

4
  • Mixing and matching with C++ compilers almost never works. The runtimes/name-mangling rules/etc are usually incompatible. That said, did you try it? Commented Mar 29, 2012 at 15:41
  • 1
    Same as (SO)Can I link object files made by one compile to those made by another one? Commented Mar 29, 2012 at 15:43
  • @Carl: I'm porting a very large project from Linux to Windows and I had partial success compiling it with mingw. I have a hard time compiling it with MSVC. However, our users will link our static library in Visual Studio. So I wanted a clear answer before embarking in a port for mingw. Commented Mar 29, 2012 at 16:01
  • @Attila: Thanks for pointing me to that question. When I searched for an answer on StackOverflow, it somehow did not come up in the results... Commented Mar 29, 2012 at 16:04

1 Answer 1

4

No, it is not possible due to ABI for c++ is not standard and gcc's ABI differs from MSVC++ one.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.