编译OpenCV </tr1>时找不到<tr1 random =“”>

时间:2013-02-20 10:36:52

标签: ios xcode opencv cmake

我正在尝试按照这些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

我做错了什么?

1 个答案:

答案 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 ...希望这会有所帮助..