2

I have gcc and g++ correctly set. However, when I try to install OpenCV, it gives me this error -

g++: error: /Users/vgokhale/Desktop/opencv-2.4.5/modules/highgui/src/window_cocoa.mm: Objective-C++ compiler not installed on this system

I am not sure how to set the Objective-C++ compiler. I thought this would be g++? Searching google doesn't return much. This seems to be a very rare error. Why does this occur?

4

2 回答 2

0

试试这个:

cmake -j4 -G "Unix Makefiles" -D CMAKE_CXX_COMPILER=/usr/bin/g++ -D CMAKE_C_COMPILER=/usr/bin/gcc ..

我必须明确设置编译器。

于 2013-12-17T01:16:22.937 回答
0

编译器应该已经可以工作而无需对其进行调整。您所要做的就是使用 .mm 扩展名(而不是 .m)来命名您的 Objective-C 文件,然后就可以开始使用了。查看此链接以获取更多信息: 什么是 Objective C++?

于 2013-06-10T20:58:13.260 回答