Golang中国
github.com/hybridgroup/go-opencv/opencv
# github.com/hybridgroup/go-opencv/opencv
In file included from /usr/local/include/opencv2/core/core.hpp:48:0,
                 from opencv.h:16,
                 from opencv/cv.go:7:
/usr/local/include/opencv2/core.hpp:49:4: error: #error core.hpp header must be compiled as C++
 #  error core.hpp header must be compiled as C++
    ^
In file included from /usr/local/include/opencv2/core.hpp:54:0,
                 from /usr/local/include/opencv2/core/core.hpp:48,
                 from opencv.h:16,
                 from opencv/cv.go:7:
/usr/local/include/opencv2/core/base.hpp:49:4: error: #error base.hpp header must be compiled as C++
 #  error base.hpp header must be compiled as C++
    ^
/usr/local/include/opencv2/core/base.hpp:52:19: fatal error: climits: No such file or directory
 #include <climits>
                   ^
compilation terminated.

jimmykuu 于 2015-07-07 13:18 修改
7 回复
leopardxu
#1 leopardxu • 2015-07-07 15:03

自己顶起来,困扰很久了!

chfakht
#2 chfakht • 2015-07-09 04:39

HELP HELP HELP PLEASE
I’m having the same errros

jimmykuu
#3 jimmykuu • 2015-07-09 10:36
/usr/local/include/opencv2/core/base.hpp:52:19: fatal error: climits: No such file or directory
 #include <climits>
                   ^

看看是不是缺少文件。

leopardxu
#4 leopardxu • 2015-07-09 11:13

我感觉是不是缺少文件,是编译C文件的GCC 没关联到这个文件,但不知道怎么解决.

leopardxu
#5 leopardxu • 2015-07-09 17:56

问题应该出在下面,少一个opencv2 的路径,这个怎么加进去呢?

pkg-config —cflags opencv

-I/usr/local/include/opencv -I/usr/local/include 

leopardxu
#6 leopardxu • 2015-07-13 12:43

lazywei 包可以用了**哈哈哈

mrshelly
#7 mrshelly • 2016-09-29 10:12

@leopardxu
我也遇到同样的问题, 修改 opencv.pc 后, include 里的问题解决了. 现在 还存在
libopencv_gpu.so.2.4 找不到的错误.

我已经在 opencv.pc 里面加上 Lib path 了…

需要 登录 后方可回复, 如果你还没有账号你可以 注册 一个帐号。