I need to use a third party .lib / .dll file (probably compiled in Visual Studio) with my project in Eclipse CDT using MinGW.
I can dynamically link with the 32-bit version (using 32-bit MinGW) successfully but not with the 64-bit version (using 64-bit MinGW). When I run the 64-bit version, it crashes when invoking the third party function.
Is there something different that I need to do to get 64-bit working?
preguntado el 28 de agosto de 12 a las 09:08
The solution for me was to link against the 32-bit .lib file for 32-bit builds and the 64-bit . Dll file for 64-bit builds.
I'm still not sure where the inconsistency comes from, so any comments are welcome.
Microsoft Visual Studio uses a different set of ABI if compared to GCC ( MinGW ).
It's not easy to make this work, many projects and libraries offers 2 versions of their library for Windows just to solve this issue, one for MSVS and one for MinGW.
The C++ ABI are different but there is a common ABI set with the C language, a trick consist in using the
extern C keyword and try to use C++ code in a Camino C and link it as C code.
The answer to your question is no, you can try some trick but there is no standard ABI for this and no guarantee to make this work.
Either way you need to access the source code of your library to at least try something or recompile the library with MinGW, you can also try to send an email to the developer that probably doesn't know about this issue under Windows and ask for a different version of this library. What you have right now is useless without Visual Studio.