Page MenuHomePhabricator

[Yosemite] OpenCV SuperBuild doesn't compile
Closed, ResolvedPublic

Description

Errors:

/Users/jc/developing/classification/MITK-MBI-debug/MITK-superbuild/ep/src/OpenCV/modules/highgui/src/window_cocoa.mm:154:42: error: cannot initialize a parameter of type

'NSApplicationActivationPolicy' with an rvalue of type 'int'
  [application setActivationPolicy:0/*NSApplicationActivationPolicyRegular*/];
                                   ^

/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:224:60: note: passing argument to parameter 'activationPolicy' here

  • (BOOL)setActivationPolicy:(NSApplicationActivationPolicy)activationPolicy NS_AVAILABLE_MAC(10_6); ^

1 error generated.
make[8]: * [modules/highgui/CMakeFiles/opencv_highgui.dir/src/window_cocoa.mm.o] Error 1
make[8]:
* Waiting for unfinished jobs....

or...

[ 50%] In file included from .../MITK-superbuild/ep/src/OpenCV/modules/flann/src/miniflann.cpp:1:
MITK-superbuild/ep/src/OpenCV/modules/flann/src/precomp.hpp:21:
MITK-superbuild/ep/src/OpenCV/modules/flann/include/opencv2/flann/all_indices.h:42:
MITK-superbuild/ep/src/OpenCV/modules/flann/include/opencv2/flann/lsh_index.h:49:
/Users/jc/developing/classification/MITK-MBI-debug/MITK-superbuild/ep/src/OpenCV/modules/flann/include/opencv2/flann/lsh_table.h:49:10: fatal error: 'unordered_map' file not found
#include <unordered_map>

^

MITK-superbuild/ep/src/OpenCV/modules/flann/src/flann.cpp:29:
MITK-superbuild/ep/src/OpenCV/modules/flann/src/precomp.hpp:21:
MITK-superbuild/ep/src/OpenCV/modules/flann/include/opencv2/flann/all_indices.h:42:
MITK-superbuild/ep/src/OpenCV/modules/flann/include/opencv2/flann/lsh_index.h:49:
MITK-superbuild/ep/src/OpenCV/modules/flann/include/opencv2/flann/lsh_table.h:49:10: fatal error: 'unordered_map' file not found
#include <unordered_map>

Event Timeline

The same problem appeared on mbima01 with the continuous CDash client for our internal code base.

It was caused by our CMake scripts adding libstdc++ as the standard library, which does not work in combination with -std=c++11. This has been fixed in our internal MBI repository.

The unorderd map include was found correctly.

But the following error persists:

..MITK-debug/ep/src/OpenCV/modules/highgui/src/window_cocoa.mm:154:42: error: cannot initialize a parameter of type 'NSApplicationActivationPolicy' with

an rvalue of type 'int'
  [application setActivationPolicy:0/*NSApplicationActivationPolicyRegular*/];
                                   ^

/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:224:60: note: passing argument to parameter 'activationPolicy' here

  • (BOOL)setActivationPolicy:(NSApplicationActivationPolicy)activationPolicy NS_AVAILABLE_MAC(10_6); ^

I fixed the problem changing

setActivationPolicy:0/*NSApplicationActivationPolicyRegular*/];

to

setActivationPolicy:NSApplicationActivationPolicyRegular];

in the opencv src

OpenCV 2.4.11 seems to work. I will try to update the OpenCV version for the upcoming release.

User fetzer has pushed new remote branch:

bug-18737-opencv-build-fails-on-yosemite

[50b9f5]: Merge branch 'bug-18737-opencv-build-fails-on-yosemite'

Merged commits:

2015-03-06 13:21:18 Andreas Fetzer [1ed4ea]
Adapted patch to new opencv version


2015-03-04 15:26:29 Andreas Fetzer [4c69a0]
Fixed tarball and reactivated patch again


2015-03-04 10:08:03 Andreas Fetzer [e4052a]
Updated OpenCV version to 2.4.11.

Uncommented patch command, which might not be necessary any more.

[ea7ef3]: Merge branch 'bug-18737-opencv-build-fails-on-yosemite'

Merged commits:

2015-03-09 16:04:54 Andreas Fetzer [ea2b61]
COMP Fixed cdash script path for windows


2015-03-09 16:06:57 Andreas Fetzer [3e5ea8]
COMP Added patch for:
invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
error on some clang versions