为方便我们知道到我们到底需要使用哪些库文件,这里我们使用《OpenCV2.3.x/2.4.x在Visual Studio2005/2008和Visual Studio2010配置方法详解 》一文中所讲述的第二种方法添加程序依赖库。我们在头文件与主函数之间添加如下代码:
#pragma comment( lib,"libjasperd.lib" ) #pragma comment( lib,"libjpegd.lib" ) #pragma comment( lib,"libpngd.lib" ) #pragma comment( lib,"libtiffd.lib" ) #pragma comment( lib, "zlibd.lib") #pragma comment( lib,"opencv_highgui241d.lib" ) #pragma comment( lib,"opencv_core241d.lib" )
编译程序,会发发现程序不能正常编译(错误如图2所示),这主要与MSVCRT.lib(MSVCR90.dll)有关。图2 编译产生很多错误