我正在尝试按照这些instructions编译OpenCV for iOS。
我安装了最新的iOS SDK和CMake版本2.8.10.2。
我需要符号链接,但是我收到了这个错误:
In file included from /Users/xxx/SourceCode/OpenCV/opencv/modules/softcascade/src/integral_channel_builder.cpp:43:
In file included from /Users/xxx/SourceCode/OpenCV/opencv/modules/softcascade/src/precomp.hpp:56:
/Users/xxx/SourceCode/OpenCV/opencv/modules/softcascade/src/_random.hpp:75:12: fatal error: 'tr1/random' file not found
# include <tr1/random>
^
我已经检查过该文件是否在我的笔记本电脑find /Developer/ -name random
中,这就是我得到的:
XXXX-MacBook-Pro:/ xxx$ find /Developer/ -name random
/Developer//Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/c++/4.2.1/tr1/random
/Developer//Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/include/c++/4.2.1/tr1/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/c++/4.2.1/tr1/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/random
/Developer//Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/tr1/random
/Developer//Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/random
我做错了什么?
答案 0 :(得分:3)
我也有这个编译错误。 我更改了文件“ios / cmake / Modules / Platform / iOS.cmake” 第43行
set(CMAKE_CXX_FLAGS“-stdlib = libc ++ -headerpad_max_install_names -fvisibility = hidden -fvisibility-inlines-hidden”)
到
set(CMAKE_CXX_FLAGS“-stdlib = libstdc ++ -headerpad_max_install_names -fvisibility = hidden -fvisibility-inlines-hidden”)
成功构建opencv.framework ...希望这会有所帮助..