我编写了使用dlib人脸识别的c ++函数。在Mac上我的代码工作正常但我无法将其编译到iOS。 首先,我用
生成了Xcode项目cmake -G Xcode ..
当我尝试通过Xcode项目构建库时,链接器
Ld xcodebuild/Debug-iphoneos/dlibwrapper.bundle/dlibwrapper normal arm64
cd /Users/MKoi/dlib-19.7/examples
export IPHONEOS_DEPLOYMENT_TARGET=11.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk -L/Users/MKoi/dlib-19.7/examples/xcodebuild/Debug-iphoneos -F/Users/MKoi/dlib-19.7/examples/xcodebuild/Debug-iphoneos -F/Library/Frameworks -filelist /Users/MKoi/dlib-19.7/examples/xcodebuild/examples.build/Debug-iphoneos/dlibwrapper.build/Objects-normal/arm64/dlibwrapper.LinkFileList -miphoneos-version-min=11.1 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/MKoi/dlib-19.7/examples/xcodebuild/examples.build/Debug-iphoneos/dlibwrapper.build/Objects-normal/arm64/dlibwrapper_lto.o -Xlinker -no_deduplicate -bundle -Wl,-headerpad_max_install_names /Users/MKoi/dlib-19.7/examples/xcodebuild/dlib_build/Debug-iphoneos/libdlib.a /usr/lib/libcblas.dylib /usr/lib/liblapack.dylib /usr/lib/libsqlite3.dylib -Xlinker -dependency_info -Xlinker /Users/MKoi/dlib-19.7/examples/xcodebuild/examples.build/Debug-iphoneos/dlibwrapper.build/Objects-normal/arm64/dlibwrapper_dependency_info.dat -o /Users/MKoi/dlib-19.7/examples/xcodebuild/Debug-iphoneos/dlibwrapper.bundle/dlibwrapper
失败了:
ld: warning: ignoring file /usr/lib/libcblas.dylib, missing required architecture arm64 in file /usr/lib/libcblas.dylib (3 slices)
ld: warning: ignoring file /usr/lib/liblapack.dylib, missing required architecture arm64 in file /usr/lib/liblapack.dylib (3 slices)
....
Undefined symbols for architecture arm64:
....
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如何在构建中包含arm64版本的libcblas.dylib和liblapack.dylib?我错过了一些构建步骤吗?