我是开放世界大事。
我刚刚安装了开放式电脑,使C++方案成为下文。
我的编辑是视觉C++。
# include "highgui.h"
void main() {
IplImage* img = cvLoadImage("C:/OpenCV/samples/cpp/tutorial_code/images/lena.png",-1);
cvNamedWindow("lena",0);
cvShowImage("lena",image);
cvWaitKey(0);
cvReleaseImage(&image);
}
但这不能用错误的信息来加以构建,我无法解决这一问题。
错误信息如下。
(My compiler is Korean Version and I translate the error message into English. And the English is poor, but you may understand how it was processed.)
1>------ begin build: project: image1st,: Debug Win32 ------
1> compiling)
1>image1st.cpp
1>c:vs2008ccp_fileimage1stimage1st.cpp(17) : warning C4700: not inetialized ‘image’ use local variable
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>linking
1>image1st.obj : error LNK2019: _cvReleaseImage External Symbol(refrence positon: _main function) not defined.
1> image1st.obj : error LNK2019: _cvWaitKey External Symbol(refrence positon: _main function)not defined.
1> image1st.obj : error LNK2019: _cvShowImage External Symbol(refrence positon: _main function)not defined.)
1> image1st.obj : error LNK2019: _cvNamedWindow External Symbol(refrence positon: _main function)not defined.)
1>image1st.obj : error LNK2019: _cvLoadImage External Symbol(refrence positon: _main function)not defined.)
1>project: warning PRJ0018 : can not find the next environment variable.
1>$(OPENCV_DIR)
1>image1st – errors: 6, warning: 1
我修改了视像仪++环境如下。
在“包括名录”条目中,我投入了“(OPENCV_DIR)”。
and make the “Additional Dependencies” entry to include the next .lib file as the OpenCV Tutorials Release 2.3 guides.
- ‘opencv_core231d.lib’
- ‘opencv__imgproc231d.lib’
- ‘opencv__highgui231d.lib’
- ‘opencv__ml231d.lib’
- ‘opencv__video231d.lib’
- ‘opencv__features2d231d.lib’
- ‘opencv__calib3d231d.lib’
- ‘opencv__objdetect231d.lib’
- ‘opencv__contrib231d.lib’
- ‘opencv__legacy231d.lib’
- ‘opencv__flann231d.lib’
视像仪++环境的图书馆名录也作如下修改。
图书馆:
- $(VSInstallDir)lib
- $(VSInstallDir)
- $(FrameworkSDKDir)lib
- $(WindowsSdkDir)lib
- $(VCInstallDir)atlmfclibi386
- $(VCInstallDir)atlmfclib
- $(VCInstallDir)lib
- C:opencvuildx86vc10lib // modified
- C:opencvuildx86vc9lib // modified
- C:opencvuildx64vc10lib // modified
- C:opencvuildx64vc9lib // modified
- C:opencvuildgpux86lib // modified
- C:opencvuildgpux64lib // modified
包括:
- $(VCInstallDir)atlmfcinclude
- $(WindowsSdkDir)include
- $(FrameworkSDKDir)include
- $(VCInstallDir)include
- C:OpenCVuildincludeopencv // modified
- C:OpenCVuildincludeopencv2 // modified
- C:opencvuildinclude // modified