在XCode上使用定制的OpenCV for iOS生成___sincos_stret未定义的符号 [英] Using custom built OpenCV for iOS on XCode produces ___sincos_stret undefined symbol
问题描述
我想在我的iPhone应用程序使用一个C ++静态库使用修改版本的OpenCV for iOS,我困在这个问题在链接时间:
架构armv7的未定义符号:
pre>
___sincos_stret,引用自:opencv2(imgwarp.o)
cv :: initInterTab2D(int,bool)
ld:没有为结构armv7找到符号
clang:error:linker命令失败,退出代码1(使用-v查看调用)
我真的不明白我缺少什么,该功能似乎并没有在OpenCV中出现,我在网上找不到任何有意义的东西;我想知道它是否在一些数学库,但我还没有找到任何东西。
我使用Clang编译OpenCV并使用默认的libc ++库。 / p>
libmylibrary.a和OpenCV2框架正确地在链接库列表中。
到XCode,因此我可能错过了一些微不足道的静态库的编译和/或在链接到我的项目。
我没有改变该对象的源代码,因为我的更改与OpenCV的imgproc模块的另一部分相关,因此,我猜想即使使用默认版本也可能发生这种情况。
Do你有什么线索吗?
解决方案我遇到这个问题安装XCode 5开发者预览和构建OpenCV与
build_framework.py
脚本。___ sincos_stret
似乎是来自使用新的编译器版本。
我通过更改路径到命令行工具。
在终端中,验证XCode命令行路径:
code> xcode-select --print-path
c $ c> XCode5-DP.app ,然后切换到Xcode 4的工具:
xcode-select --switch /Applications/XCode.app/Contents/Developer
重建框架。然后尝试重新编译项目。
I'm trying to use a C++ static library into my iPhone app which uses a modified version of OpenCV for iOS and I'm stuck with this issue at linking time:
Undefined symbols for architecture armv7: "___sincos_stret", referenced from: cv::initInterTab2D(int, bool) in opencv2(imgwarp.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I really do not understand what I'm missing, that function does not seem to be present in OpenCV and I do not find anything meaningful on the web; I'm wondering if it's in some mathematical library, but I haven't found anything yet.
I've compiled OpenCV with Clang and using the default libc++ library.
The libmylibrary.a and the OpenCV2 framework are correctly in the list of linked libraries.
I'm new to XCode, therefore I could have missed something trivial in the compilation of the static library and/or in the linking of it into my project.
I haven't changed the source code of that object as my changes were related to another part of the imgproc module of OpenCV, therefore I guess that this could have happen even using the default version.
Do you have any clues?
解决方案I ran into this problem after installing the XCode 5 developer preview and building OpenCV with the
build_framework.py
script.___sincos_stret
appears to be coming from using the new compiler version.I fixed this problem by changing the path to the command-line tools.
In Terminal, verify the XCode command-line path:
xcode-select --print-path
If it prints a path inside
XCode5-DP.app
, then switch to the tools for Xcode 4:xcode-select --switch /Applications/XCode.app/Contents/Developer
And rebuild the framework. Then try recompiling the project.
这篇关于在XCode上使用定制的OpenCV for iOS生成___sincos_stret未定义的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!