如何在iOS项目中包含C库(VLFeat 0.9.21)?

时间:2018-02-24 23:02:41

标签: ios c vlfeat

编译VLFeat(一个开源C库)并将其包含在我的iOS项目中需要采取哪些必要步骤?这是我到目前为止所发现的:

我对编译和链接过程并不太熟悉,但从我目前的理解,我需要为arm64架构编译VLFeat,以便在iPhone上运行。

有关如何在XCode中包含VLFeat的严格过时指南: http://www.vlfeat.org/xcode.html

但是当我按照这些步骤操作时,我收到以下错误:

Undefined symbols for architecture arm64:
"_vl_get_printf_func", referenced from:
  -[OpenCVWrapper createMatrixFromImage:] in OpenCVWrapper.o
ld: symbol(s) not found for architecture arm64

我怀疑这是因为该库实际上是为OSX构建的(因此对于不同的架构)。我无法弄清楚如何为iOS(arm架构)构建这个并让它在物理iPhone上运行。

当我打开VLFeat下载中包含的XCode项目并开始为其中一个目标构建设置并将Base SDK更改为iOS并将Supported platforms更改为iOS和Valid Architectures时到arm64然后尝试构建,VLFeat源代码出现了一堆错误,例如:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/mmintrin.h:64:12: Invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size

"Compiling with SSE2 enabled, but no __SSE2__ defined"

这些错误让我怀疑实际上不可能为arm构建这个库,并且没有移植库(修改代码),这是一项不可能完成的任务。我不确定我得出的结论是否正确,所以对此的任何意见都会有所帮助。

0 个答案:

没有答案