LNK2005 Error linking static openCV libraries with Visual Studio and QT Creator

你说的曾经没有我的故事 提交于 2019-12-01 17:29:06

On CMake, when building the openCV static libraries, besides unchecking BUILD_SHARED_LIBS I also unchecked BUILD_WITH_STATIC_CRT, and that took care of that particular problem

Make sure that the Project properties->Configuration Properties->c/c++>Code Generation: Runtime Library is Multi-threaded (/MT)

The problem seem to be that your linker attempts to combine different, incompatible versions of the Visual C++ runtime library (CRT) into one single binary.
Let me guess in the wild: Each part of your project and the libraries you link against are NOT generated with the same code generation options in Visual C++.
I wonder if the /NODEFAULTLIB switch 'd solve this challenge?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!