【发布时间】:2012-02-24 01:56:47
【问题描述】:
我有一个只有导入的文件:
#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 进行编译
但得到一点错误:
在 /usr/include/opencv/cxcore.hpp:46 包含的文件中, 来自 m.cpp:5: /usr/include/opencv/cxmisc.h:214:错误:“void”之前的预期构造函数、析构函数或类型转换 /usr/include/opencv/cxmisc.h:220:错误:在“int”之前需要构造函数、析构函数或类型转换 /usr/include/opencv/cxmisc.h:226:错误:“CV_INLINE”没有命名类型 /usr/include/opencv/cxmisc.h:516:错误:未在此范围内声明“CV_DEPTH_MAX” /usr/include/opencv/cxmisc.h:522:错误:未在此范围内声明“CV_DEPTH_MAX” /usr/include/opencv/cxmisc.h:522:错误:未在此范围内声明“CV_CN_MAX” 在 m.cpp:5 包含的文件中: /usr/include/opencv/cxcore.hpp:70:错误:'cv::CV_EXPORTS cv::Size_'的模板声明 /usr/include/opencv/cxcore.hpp:71:错误:'cv::CV_EXPORTS cv::Point_'的模板声明 /usr/include/opencv/cxcore.hpp:72:错误:'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:错误:“格式”之前的预期初始化程序 /usr/include/opencv/cxcore.hpp:82:错误:“:”令牌之前的预期初始化程序 m.cpp:38:错误:输入结尾处应为“}”
这是我的 copencv 库内容:
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
我在 ubuntu 10.10
【问题讨论】:
标签: c++ opencv image-processing compilation