How to link to VS2008 generated .libs from g++

后端 未结 5 505
悲&欢浪女
悲&欢浪女 2021-01-23 10:17

I am trying to build a dll using mingw g++ under cygwin.

I have .h files that refer to objects exported by a .dll that was build using MS Visual Studio 2008. I link to t

5条回答
  •  孤街浪徒
    2021-01-23 10:35

    Object code produced by different C++ compilers is not link compatible.

    This is done on purpose: compilers use different ABI, and if the name maingling didn't prevent you from linking, you'd now be wondering/debugging why the simplest operations are causing your executable to crash.

    You should be grateful that the different name mangling scheme spared you that debugging effort.

提交回复
热议问题