у меня есть файл только с импортом:
#include <iostream>
#include <stdio.h>
#include "cxcore.hpp"
#include "highgui.hpp"
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
}
и я пытаюсь скомпилировать с g++ -I/usr/include/opencv -lopencv -lm m.cpp
но получаю ошибку whit:
In file included from /usr/include/opencv/cxcore.hpp:46, из m.cpp:5: /usr/include/opencv/cxmisc.h:214: error: expected constructor, destructor, or type conversion before 'void' /usr/include/opencv/cxmisc.h:220: error: expected constructor, destructor, or type conversion before 'int' /usr/include/opencv/cxmisc.h:226: ошибка: 'CV_INLINE' не называет тип /usr/include/opencv/cxmisc.h:516: ошибка: 'CV_DEPTH_MAX' не был объявлен в этой области видимости /usr/include/opencv/cxmisc.h:522: error: 'CV_DEPTH_MAX' was not declared in this scope /usr/include/opencv/cxmisc.h:522: error: 'CV_CN_MAX' was not declared in this scope В файле, включенном из m.cpp:5: /usr/include/opencv/cxcore.hpp:70: error: template declaration of 'cv::CV_EXPORTS cv::Size_' /usr/include/opencv/cxcore.hpp:71: error: template declaration of 'cv::CV_EXPORTS cv::Point_' /usr/include/opencv/cxcore.hpp:72: error: template declaration of 'cv::CV_EXPORTS cv::Rect_' /usr/include/opencv/cxcore.hpp:77: ошибка: ожидаемый инициализатор перед 'fromUtf16' /usr/include/opencv/cxcore.hpp:78: ошибка: ожидаемый инициализатор перед 'toUtf16' /usr/include/opencv/cxcore.hpp:80: ошибка: ожидаемый инициализатор перед 'format' /usr/include/opencv/cxcore.hpp:82: error: expected initializer before ':' token m.cpp:38: error: expected '}' at end of input
this is my copencv lib content:
alberto@zefiro:~$ ls /usr/include/opencv/
cvaux.h cvcompat.h cv.hpp cvtypes.h cvvidsurv.hpp cxcore.h cxerror.h cxmat.hpp cxoperations.hpp highgui.h ml.h
cvaux.hpp cv.h cvinternal.h cvver.h cvwimage.h cxcore.hpp cxflann.h cxmisc.h cxtypes.h highgui.hpp
i'm on ubuntu 10.10