It's possible to use code (and libraries) compiled with VisualC++ (so with .lib extension) in a project that will use GCC as compiler (and vice versa)? Or I have to rebuild them?
I'm trying to use SOCI 3.1 libraries that I have compiled with VisualC++ in a project that has GCC as compiler, but I'm getting some errors, and I don't know why..
Asked
Active
Viewed 378 times
1

Overflowh
- 1,103
- 6
- 18
- 40
-
http://stackoverflow.com/questions/4265639/is-it-possible-to-use-a-gcc-compiled-library-with-msvc – Oleksandr Kravchuk Dec 02 '12 at 23:46
1 Answers
2
You have to produce binaries for GCC using MinGW tools: reimp and dlltool. Here is MinGW wiki with complete explanation of the procedures: MSVC and MinGW DLLs
Short example:
reimp -d libmysql.lib
dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a
reimp libmysql.lib
By the way, here is related thread on SOCI users mailing list which: MySQL Build fails. Look for useful links given in the thread.

Stefan Zobel
- 3,182
- 7
- 28
- 38

mloskot
- 37,086
- 11
- 109
- 136