嗨,我构建了我的代码,我收到错误消息
./src/view.o: In function cv::Mat::MSize::MSize(int*)':
/home/burak/desktop/workspace/deneme/Debug/../src/view.cpp:13: multiple definition of
main' ./src/deneme.o:/home/burak/desktop/workspace/deneme/Debug/../src/deneme.cpp:12: 首先在这里定义 collect2: 错误: ld 返回 1 退出状态 make: * [deneme] 错误 1
我的代码是
#include <opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<cv.h>
#include<iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
{
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
///// Show Image... and main return 0 ///
我该如何解决?