Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build the static Opencv library with multi-threaded debug DLL (/MDd) C runtime library

Tags:

c++

opencv

I am now trying to build opencv with cmake, and if I use the following command:

cmake -DBUILD_SHARED_LIBS=OFF ..

I can build a static OPENCV libary. However, the built library links C run time library statically. In VC2010, it uses Multi-threaded Debug (/MTd) option. What I expects is to link C run time library dynamically, and that is using /MDd option in VC2010, then what can I do to make it possible? Thanks.

like image 414
feelfree Avatar asked Nov 04 '13 16:11

feelfree


1 Answers

Add -DBUILD_WITH_STATIC_CRT=OFF to CMake command line:

cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_WITH_STATIC_CRT=OFF ..
like image 164
jet47 Avatar answered Nov 15 '22 20:11

jet47