Qt在VS2010下的配置 (转载)

原文链接:http://sirivy.wordpress.com/2013/11/22/configurations-on-msvc-2010-express-for-using-opencv-and-qt/

 

Add Include directories

In this example, I add Include directories for Boost, Qt, OpenCV, and VLD.

Right click at project name in Solution Explorer->Configuration Properties->C/C++->General->Additional Include Directories->Edit… . Then, you have to add the following paths as shown in figure below.

Image

Include header files for Qt library
$(QT_DIR)\include
$(QT_DIR)\include\QtCore
$(QT_DIR)\include\QtGui

Include header files for OpenCV
C:\OpenCV-2.4.5\opencv\build\include\opencv2
C:\OpenCV-2.4.5\opencv\build\include\opencv
C:\OpenCV-2.4.5\opencv\build\include

Include header files for C++ Boost
C:\boost_1_54_0

Include header files for Visual Leak Detector
$(VLD_DIR)\include

A QT_DIR variable value is C:\Qt\4.8.5 and VLD_DIR variable value is C:\VisualLeakDetector.
NOTE: Your variable value may be different in your case.

Add library directories

In this example, I add additional library directories for Boost, OpenCV, Qt, and VLD.

Right click at project name in Solution Explorer->Configuration Properties->Linker->General->Additional Library Directories->Edit…

Then, you have to add the following paths as shown in figure below.

AdditionalLibraryConfigurationForOpenCVAndQtAndVLDOnMSVC++

VLD library
$(VLD_DIR)\lib\Win32

Qt library
$(QT_DIR)\lib

Boost C++
C:\boost_1_54_0\stage\lib

OpenCV library
C:\OpenCV-2.4.5\opencv\build\x86\vc10\lib

The last step explains how to add additional dependencies for each library.

Right click at project name in Solution Explorer->Configuration Properties->Linker->Input->Additional Dependencies->Edit…. Then, you have to add .lib files that will be used in your program. In this example, I use the following libraries:

LibNameConfigurationForOpenCVAndQtAndVLDOnMSVC++

VLD library
vld.lib

Qt library
qtmain.lib
QtCore4.lib
QtGui4.lib

OpenCV library
opencv_core245.lib
opencv_highgui245.lib
opencv_flann245.lib
opencv_nonfree245.lib
opencv_features2d245.lib
opencv_objdetect245.lib
opencv_video245.lib
opencv_imgproc245.lib
opencv_ml245.lib

NOTE: This example shows a configuration in release mode. If you would like to configure your project for debug mode, dependencies name may be slightly different.

posted @ 2014-10-22 05:16  Learn Open CAD  阅读(291)  评论(0编辑  收藏  举报