face-landmarking-ios icon indicating copy to clipboard operation
face-landmarking-ios copied to clipboard

Apple Mach-O Linker (ld) Error Group

Open scorrea92 opened this issue 6 years ago • 3 comments

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_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 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.

scorrea92 avatar May 06 '18 13:05 scorrea92

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

Hardy143 avatar Jul 13 '18 10:07 Hardy143

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

scorrea92 avatar Jul 13 '18 11:07 scorrea92

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.

Hardy143 avatar Jul 18 '18 12:07 Hardy143