iOS将dlib添加到项目,链接器错误

Posted

技术标签:

【中文标题】iOS将dlib添加到项目,链接器错误【英文标题】:iOS add dlib to project, linker error 【发布时间】:2018-01-18 12:14:22 【问题描述】:

我在关注this tutorial 时遇到此错误:

ld: warning: ignoring file /project/lib/libdlib.a, file was built for archive which is not the architecture being linked (arm64): /project/lib/libdlib.a
Undefined symbols for architecture arm64:
  "_cblas_dgemm", referenced from:
      dlib::blas_bindings::cblas_gemm(dlib::blas_bindings::CBLAS_ORDER, dlib::blas_bindings::CBLAS_TRANSPOSE, dlib::blas_bindings::CBLAS_TRANSPOSE, int, int, int, double, double const*, int, double const*, int, double, double*, int) in DlibWrapper.o
  "_dgesvd_", referenced from:
      dlib::lapack::binding::gesvd(char, char, long, long, double*, long, double*, double*, long, double*, long, double*, long) in DlibWrapper.o
  "_dgesdd_", referenced from:
      dlib::lapack::binding::gesdd(char, long, long, double*, long, double*, double*, long, double*, long, double*, long, long*) in DlibWrapper.o
  "_USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives", referenced from:
      _dlib_check_consistent_assert_usage in DlibWrapper.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我能做什么?

【问题讨论】:

添加构建设置 -> 架构到标准架构(armv7、armv7s、arm64)。 @Anbu.Karthik 在 dlib 项目中还是在我的项目中? 检查两个..... 请参阅此参考:***.com/questions/20926632/… @Anbu.Karthik 没有帮助,同样的错误:( 【参考方案1】:

添加加速框架

对于 ios 和 macOS 平台,框架包含符号。

【讨论】:

以上是关于iOS将dlib添加到项目,链接器错误的主要内容,如果未能解决你的问题,请参考以下文章

将 dlib 链接到 Xcode

Xcode 存档链接器错误 dlib

如何修复编译 Mach-O 链接器错误

将 Cocoa Touch 框架链接到 Today Extension 时出现链接器错误

opencv2 IOS框架链接器错误

facebook SDK3.1 和 Xcode 4.5 链接器错误