Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Eclipse give an errors when I try to compile Opencv program

./src/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.o:(.data+0x0): multiple definition of info_compiler' ./src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.o:(.data+0x0): first defined here ./src/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.o:(.data+0x4): multiple definition ofinfo_platform' ./src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.o:(.data+0x4): first defined here ./src/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.o:(.data+0x8): multiple definition of info_arch' ./src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.o:(.data+0x8): first defined here ./src/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.o: In functionmain': /eclipse/opencv/Debug/../src/CMakeFiles/2.8.10.1/CompilerIdC/CMakeCCompilerId.c:382: multiple definition of main' ./src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.o: /eclipse/opencv/Debug/../src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp:366: first defined here ./src/dialogwindow.o: In functioncv::MatSize::MatSize(int)': /eclipse/opencv/Debug/../src/dialogwindow.cpp:18: multiple definition of `main' ./src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.o:/eclipse/opencv/Debug/../src/CMakeFiles/2.8.10.1/CompilerIdCXX/CMakeCXXCompilerId.cpp:366: first defined here collect2: error: ld returned 1 exit status make: ** [opencv] Error 1

include "opencv2/highgui/highgui_c.h"

include<opencv2 highgui="" highgui.hpp="">

include <iostream>

using namespace cv; using namespace std; int main( int argc, char** argv ){ Mat image; image = imread( argv[1], 1 );

if( argc != 2 || !image.data ) { cout << "No image data \n" <<endl; return="" -1;="" }<="" p="">

namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); imshow( "Display Image", image );

waitKey(0);

return 0; }