简体   繁体   English

在ubuntu14.04上编译caffe-1.0时出现opencv错误

[英]opencv error when compiling caffe-1.0 on ubuntu14.04

I came into a bug when compiling the latest caffe-1.0 with opencv. 我用opencv编译最新的caffe-1.0时遇到了一个bug。
I compiled it on ubuntu14.04 using gcc-4.8.5 with cuda8.0 and cudnn5.1. 我使用gcc-4.8.5和cuda8.0以及cudnn5.1在ubuntu14.04上编译它。
I tried different versions of opencv(2.4.8, 2.4.13, 3.2.0) but the error continued. 我尝试了不同版本的opencv(2.4.8,2.4.13,3.2.0),但错误仍在继续。
The error is as follows: 错误如下:

/usr/include/opencv2/core/core.hpp:4127:9: error: expected identifier before ‘float’
FLOAT=REAL, //!< synonym or REAL
^
/usr/include/opencv2/core/core.hpp:4127:9: error: expected ‘}’ before ‘float’
In file included from examples/cpp_classification/classification.cpp:3:0:
/usr/include/opencv2/core/core.hpp:4127:14: error: expected unqualified-id before ‘=’ token
FLOAT=REAL, //!< synonym or REAL
^
/usr/include/opencv2/core/core.hpp:4140:22: error: expected unqualified-id before ‘)’ token
CV_WRAP FileNode();
^
/usr/include/opencv2/core/core.hpp:4142:14: error: expected unqualified-id 
before ‘const’
FileNode(const CvFileStorage* fs, const CvFileNode* node);
^
/usr/include/opencv2/core/core.hpp:4142:14: error: expected ‘)’ before ‘const’
/usr/include/opencv2/core/core.hpp:4144:14: error: expected unqualified-id before ‘const’
FileNode(const FileNode& node);
^
/usr/include/opencv2/core/core.hpp:4144:14: error: expected ‘)’ before ‘const’
/usr/include/opencv2/core/core.hpp:4146:49: error: non-member function ‘cv::FileNode cv::operator[](const string&)’ cannot have cv-qualifier
FileNode operator[](const string& nodename) const;

I sloved the problem myself. 我自己解决了这个问题。

The error occured because I compiled and installed the latest OpenBlas library, version 0.2.19. 发生错误是因为我编译并安装了最新的OpenBlas库,版本0.2.19。 The file cblas.h caused the opencv problem. 文件cblas.h导致了opencv问题。

I just renamed the cblas.h in /usr/local/include so the command make will use the cblas.h in /usr/include and succeeded finally. 我刚刚在/ usr / local / include中重命名了cblas.h,所以命令make将使用/ usr / include中的cblas.h并最终成功。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM