我正在尝试显示图像,这 3 个错误即将到来..
错误 1
error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z) referenced in function _main
C:\Users\jai guru umesh\Documents\Visual Studio 2010\Projects\test\test\
test.obj
test
错误 2
error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QAE@ABVMat@1@@Z) referenced in function _main
C:\Users\jai guru umesh\Documents\Visual Studio 2010\Projects\test\test\
test.obj
test
错误 3
error LNK1120: 2 unresolved externals
C:\Users\jai guru umesh\Documents\Visual Studio 2010\Projects\test\Debug\test.exe
1
1
测试
程序
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
Mat image;
image = imread("C:\\Users\\jai guru umesh\\Desktop\\6.jpg " ,0);
// any other variables must also be declared here
if( argc != 2) {
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", CV_WINDOW_AUTOSIZE );// Create a window for display.
imshow("Display Window",image); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}