0

我正在尝试按照这些说明为 iOS 编译 OpenCV 。

我已经安装了最新的 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

我究竟做错了什么?

4

1 回答 1

3

我也有这个编译错误。我更改文件“ios/cmake/Modules/Platform/iOS.cmake”第 43 行

设置(CMAKE_CXX_FLAGS “-stdlib=libc++ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden”)

设置(CMAKE_CXX_FLAGS “-stdlib=libstdc++ -headerpad_max_install_names -fvisibility=hidden -fvisibility-inlines-hidden”)

并成功构建opencv.framework ...希望这会有所帮助..

于 2013-02-23T04:42:34.677 回答