failed to make opencv.git with gcc48 on macosx mavericks
I forked the repos, and clone a copy on my computer, my OS is macosx maverick and the gcc version is 4.8
I just failed to make the fresh opencv, the error messages are as below, It is the matter of the gcc ?
In file included from /Users/benzene/works/OpenCV/opencv/modules/core/include/opencv2/core.hpp:52:0,
from /Users/benzene/works/OpenCV/opencv/modules/highgui/include/opencv2/highgui.hpp:46,
from /Users/benzene/works/OpenCV/opencv/modules/highgui/src/precomp.hpp:45,
from /Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:43:
/Users/benzene/works/OpenCV/opencv/modules/core/include/opencv2/core/base.hpp:228:35: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
# pragma GCC diagnostic ignored "-Winvalid-noreturn"
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm: In function 'void cvDestroyAllWindows()':
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:23: error: expected ';' before 'in'
for(NSString *key in list) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:23: error: 'in' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:26: error: expected ';' before 'list'
for(NSString *key in list) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:199:26: warning: for increment expression has no effect [-Wunused-value]
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm: In function 'void cvShowImage(const char*, const CvArr*)':
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:31: error: expected ';' before 'in'
for(NSString *key in [window sliders]) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:31: error: 'in' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:42: error: expected ']' before 'sliders'
for(NSString *key in [window sliders]) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:42: error: expected ';' before 'sliders'
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:42: error: 'sliders' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:49: error: expected ')' before ']' token
for(NSString *key in [window sliders]) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:49: error: expected primary-expression before ']' token
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:49: error: expected ';' before ']' token
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:229:27: warning: unused variable 'key' [-Wunused-variable]
for(NSString *key in [window sliders]) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm: In function 'const char* cvGetWindowName(void*)':
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:435:23: error: expected ';' before 'in'
for(NSString *key in windows) {
^
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:435:23: error: 'in' was not declared in this scope
/Users/benzene/works/OpenCV/opencv/modules/highgui/src/window_cocoa.mm:435:26: error: expected ';' before 'windows'
for(NSString *key in windows) {
^
/Users/benzene/works/OpenCV ...
btw, "modules/core/include/opencv2/core.hpp" looks more like you're trying to compile the 3.0(master) branch, not the 2.4.8 one. (also the line numbers match better then)
.
did you do a "git checkout 2.4" ?
.
(it probably won't solve it, just for clarity)
Same problem for me: http://codepaste.net/tackx9
I keep finding mentions about highgui needing to be compiled by "clang":
"You have to compile the CUDA components using GCC 4.5, while compiling the rest of OpenCV with Clang, otherwise you cannot get the HighGui module to work. HighGui will only compile with the Apple installed compilers because it uses Cocoa. If you do not need HighGui, you can compile OpenCV with GCC. You can specify the proper compilers quite easily with cmake."
SOURCE: http://stackoverflow.com/questions/16144966/compile-opencv-with-cuda-for-mac