大神们帮帮忙,opencv配置编译不成功(要哭了)

win7在vs2010上配置opencv3.0
按网上教程配置好了环境变量以及vs2010

输入opencv的一个小程序:

#include

#include
using namespace cv;
void main()
{
IplImage *src;
src = cvLoadImage("lena.jpg"); //这里将lena.jpg和lena.cpp文件放在同一个文件夹下
cvNamedWindow("lena",CV_WINDOW_AUTOSIZE);
cvShowImage("lena",src);
cvWaitKey(0);
cvDestroyWindow("lena");
cvReleaseImage(&src);
}

编译结果:
1>------ Build started: Project: lena, Configuration: Debug Win32 ------
1>Build started 2015/3/9 9:06:02.
1>InitializeBuildStatus:
1> Touching "Debug\lena.unsuccessfulbuild".
1>ClCompile:
1> lena.cpp
1>d:\opencv\build\include\opencv2\core\mat.hpp(1413): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>d:\opencv\build\include\opencv2\core\mat.hpp(1413): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(6): error C2065: 'IplImage' : undeclared identifier
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(6): error C2065: 'src' : undeclared identifier
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(7): error C2065: 'src' : undeclared identifier
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(7): error C3861: 'cvLoadImage': identifier not found
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(8): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(8): error C3861: 'cvNamedWindow': identifier not found
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(9): error C2065: 'src' : undeclared identifier
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(9): error C3861: 'cvShowImage': identifier not found
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(10): error C3861: 'cvWaitKey': identifier not found
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(11): error C3861: 'cvDestroyWindow': identifier not found
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(12): error C2065: 'src' : undeclared identifier
1>c:\users\apple\desktop\documents\visual studio 2010\projects\lena\lena\lena.cpp(12): error C3861: 'cvReleaseImage': identifier not found
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:02.25
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

然后尝试输入:
#include
#include

int main()
{
printf("Hello world!");

return 0;
}

编译也不成功
1>------ Build started: Project: lena, Configuration: Debug Win32 ------
1>Build started 2015/3/9 9:12:16.
1>InitializeBuildStatus:
1> Touching "Debug\lena.unsuccessfulbuild".
1>ClCompile:
1> lena.cpp
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>LINK : fatal error LNK1104: cannot open file 'opencv_calib3d300.lib'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.02
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

为什么啊55555~,版本号也是对的呀,为什么打不开opencv_calib3d300.lib

查看全部
qq_25268113
ChangEyes
2015/03/09 01:10
  • 配置
  • vs2010
  • opencv
  • 点赞
  • 收藏
  • 回答
    私信

5个回复