zweigraf / face-landmarking-ios

👦 Basic face landmarking on iPhone with Dlib via Swift & ObjC++
481 stars 125 forks source link

Apple Mach-O Linker (ld) Error Group #37

Open scorrea92 opened 6 years ago

scorrea92 commented 6 years ago

Hi, I was trying to make my own app using some dlib, content but I have this error.

ld: warning: ignoring file /Users/sebastiancorrea/Documents/UPV/Master_IARFID/TFM/Bloque2/mobile-emotion-classifier/mobile/IOS/FaceVision/FaceVision/lib/libdlib.a, file was built for archive which is not the architecture being linked (arm64): /Users/sebastiancorrea/Documents/UPV/Master_IARFID/TFM/Bloque2/mobile-emotion-classifier/mobile/IOS/FaceVision/FaceVision/lib/libdlib.a Undefined symbols for architecture arm64: "dlib::entropy_decoder_kernel_2::set_stream(std::1::basic_istream<char, std::1::char_traits >&)", referenced from: dlib::compress_stream_kernel_1<dlib::entropy_encoder_model_kernel_5<257ul, dlib::entropy_encoder_kernel_2, 200000ul, 4ul>, dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>, dlib::crc32>::decompress(std::1::basic_istream<char, std::1::char_traits >&, std::1::basic_ostream<char, std::1::char_traits >&) const in OpenCVWrapper.o "dlib::entropy_decoder_kernel_2::entropy_decoder_kernel_2()", referenced from: dlib::compress_stream_kernel_1<dlib::entropy_encoder_model_kernel_5<257ul, dlib::entropy_encoder_kernel_2, 200000ul, 4ul>, dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>, dlib::crc32>::decompress(std::1::basic_istream<char, std::1::char_traits >&, std::1::basic_ostream<char, std::1::char_traits >&) const in OpenCVWrapper.o "dlib::entropy_decoder_kernel_2::get_target(unsigned int)", referenced from: dlib::compress_stream_kernel_1<dlib::entropy_encoder_model_kernel_5<257ul, dlib::entropy_encoder_kernel_2, 200000ul, 4ul>, dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>, dlib::crc32>::decompress(std::1::basic_istream<char, std::1::char_traits >&, std::1::basic_ostream<char, std::1::char_traits >&) const in OpenCVWrapper.o dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&) in OpenCVWrapper.o "dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)", referenced from: dlib::compress_stream_kernel_1<dlib::entropy_encoder_model_kernel_5<257ul, dlib::entropy_encoder_kernel_2, 200000ul, 4ul>, dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>, dlib::crc32>::decompress(std::1::basic_istream<char, std::1::char_traits >&, std::1::basic_ostream<char, std::__1::char_traits >&) const in OpenCVWrapper.o dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&) in OpenCVWrapper.o "dlib::entropy_decoder_kernel_2::~entropy_decoder_kernel_2()", referenced from: dlib::compress_stream_kernel_1<dlib::entropy_encoder_model_kernel_5<257ul, dlib::entropy_encoder_kernel_2, 200000ul, 4ul>, dlib::entropy_decoder_model_kernel_5<257ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>, dlib::crc32>::decompress(std::1::basic_istream<char, std::1::char_traits >&, std::__1::basic_ostream<char, std::1::char_traits >&) const in OpenCVWrapper.o "_USER_ERRORmissing_dlib_all_source_cpp_fileORinconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessordirectives", referenced from: _dlib_check_consistent_assert_usage in OpenCVWrapper.o "dlib::base64::decode(std::__1::basic_istream<char, std::1::char_traits >&, std::__1::basic_ostream<char, std::__1::char_traits >&) const", referenced from: dlib::get_serialized_frontal_faces() in OpenCVWrapper.o "dlib::base64::base64()", referenced from: dlib::get_serialized_frontal_faces() in OpenCVWrapper.o "dlib::base64::~base64()", referenced from: dlib::get_serialized_frontal_faces() in OpenCVWrapper.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Can some one help me, Thank you.

Hardy143 commented 6 years ago

Hi, I'm having the same problem. Have you found a solution?

scorrea92 commented 6 years ago

No I haven’t find a solution, I just create my own methods using Opencv.

Hardy143 commented 6 years ago

I found a solution to getting this working. At the bottom of this article it explains that the problem is that the architecture in the compiled Dlib project is set up wrong. You need to change the Base SDK settings to iOS and make sure that valid architectures has arm64 in it. Then create a new Scheme for release and run it. This will create a new folder called Release-iphoneos and it's here that you copy the new libdlib.a and use that in your project.