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.
- Mixing and matching with C++ compilers almost never works. The runtimes/name-mangling rules/etc are usually incompatible. That said, did you try it?Carl Norum– Carl Norum2012-03-29 15:41:32 +00:00Commented Mar 29, 2012 at 15:41
- 1Same as (SO)Can I link object files made by one compile to those made by another one?Attila– Attila2012-03-29 15:43:34 +00:00Commented 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.J. Volkya– J. Volkya2012-03-29 16:01:18 +00:00Commented 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...J. Volkya– J. Volkya2012-03-29 16:04:48 +00:00Commented Mar 29, 2012 at 16:04
Add a comment |
1 Answer
No, it is not possible due to ABI for c++ is not standard and gcc's ABI differs from MSVC++ one.