Undefined symbols for architecture arm64: "_OBJC_CLASS_$_FIRMessaging" - ios

Hello I am trying to build a firebase unity project in Xcode, after running pod install
and start building the project I get this error :
Undefined symbols for architecture arm64:
"OBJC_CLASS$_FIRMessaging", referenced from:
objc-class-ref in libFirebaseCppMessaging.a(messaging_231c52c311096cfce13e67fa91eb9ac5.o)
"firebase::ReferenceCountedFutureImpl::CompleteHandle(unsigned long)", referenced from:
void firebase::ReferenceCountedFutureImpl::CompleteInternal<void, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*)>(unsigned long, int, char const*, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*) const&) in libFirebaseCppMessaging.a(messaging_231c52c311096cfce13e67fa91eb9ac5.o)
"firebase::ReferenceCountedFutureImpl::ReleaseMutexAndRunCallback(unsigned long)", referenced from:
void firebase::ReferenceCountedFutureImpl::CompleteInternal<void, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*)>(unsigned long, int, char const*, void firebase::ReferenceCountedFutureImpl::CompleteInternal(unsigned long, int, char const*)::'lambda'(void*) const&) in libFirebaseCppMessaging.a(messaging_231c52c311096cfce13e67fa91eb9ac5.o)
"firebase::util::ClassMethodImplementationCache::ReplaceOrAddMethod(objc_class*, objc_selector*, objc_object* ()(objc_object, objc_selector*, ...), objc_class*, bool)", referenced from:
_FirebaseMessagingHookAppDelegate in libFirebaseCppMessaging.a(messaging_231c52c311096cfce13e67fa91eb9ac5.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
any help?

One thing that you can do is make sure you've added your pod file correctly. Check the syntax is correct and if it's not working at all do a pod deinit, clean your build folder, then reinstall the pod again and run your project.
Making sure there is a link between your target and the file also could be worth looking at. Go to your project manager, select your target, and the link binary with libraries and add your pod file that way.
Xcode unittest build failed with error "Undefined symbols for architecture x86_64"
this helped also when looking around how to solve this. Best of luck.

Related

OpenCV SFM Xcode 7.2: Undefined symbols for architecture x86_64: cv::sfm::reconstruct

I have linked to all the appropriate libraries and headers in my Xcode project (where I have the samples files from OpenCV for scene_reconstruction), after building and installing OpenCV with the contrib module.
I have also applied the #define CERES_FOUND true fix that is recommended here:
https://github.com/Itseez/opencv_contrib/issues/476
The editor prompts me with the correct functions completions from the sfm module and the reconstruct.hpp file (except that the prompts I get have the last boolean is_projective flag missing from all reconstruct()'s i.e.:
one of the prompts is:
reconstruct(<#const std::vector<std::string> images#>, <#OutputArray Rs#>, <#OutputArray Ts#>, <#InputOutputArray K#>, <#OutputArray points3d#>)
I however get:
Undefined symbols for architecture x86_64:
"cv::sfm::reconstruct(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, cv::_OutputArray const&, cv::_OutputArray const&, cv::_InputOutputArray const&, cv::_OutputArray const&, bool)", referenced from:
_main in scene_reconstruction.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
when I build the project.
I did a camera calibration in the same project and it ran fine, and everything else is alright, I have been using OpenCV built from source for years now, so I've taken care of the basics.
How do I proceed to fix/probe the issue further?
It was an issue with CERES_FOUND not being set because of a version mismatch between eigen and ceres.

Third part library create 78 linker error in an Undefined symbols for architecture x86_64 section

I've installed a Library with cocoaPods (first time that I use cocoaPod)
And since I've got a lot of error inside a "Undefined symbols for architecture x86_64" section .
The libPods.a is red inside of my project and inside the pods Product group , the Foundation.framework is red inside the pods.
I've tried to reInstall it , to clear the project(derivedData too) , to delete libPod.a from the linked library and other stuff the problem stay the same .
My PodFile is:
platform :ios, '8.0'
pod 'MobileVLCKit'
the error are in a section Undefined symbols for architecture x86_64:
all the error except the five last one start like that :
"std::
(I'm gonna give an example : "std::basic_string, std::allocator >::find(wchar_t const*, unsigned long, unsigned long) const", referenced from:
TagLib::String::find(TagLib::String const&, int) const in MobileVLCKit(tstring.cpp.o)
TagLib::String::split(TagLib::String const&) const in MobileVLCKit(tstring.cpp.o))
after their is three starting like that
"VTT for std::
(
"VTT for std::basic_stringstream, std::allocator >", referenced from:
dash::mpd::Segment::toChunk() in MobileVLCKit(libdash_plugin_la-Segment.o
)
dash::http::PersistentConnection::prepareRequest(dash::http::Chunk*) in MobileVLCKit(libdash_plugin_la-PersistentConnection.o)
libebml::IOCallback::writeFully(void const*, unsigned long) in MobileVLCKit(IOCallback.o)
libebml::IOCallback::readFully(void*, unsigned long) in MobileVLCKit(IOCallback.o)
libebml::MemIOCallback::MemIOCallback(unsigned long long) in MobileVLCKit(MemIOCallback.o)
libebml::StdIOCallback::StdIOCallback(char const*, open_mode) in MobileVLCKit(StdIOCallback.o)
libebml::StdIOCallback::close() in MobileVLCKit(StdIOCallback.o)
...
)
and two like that
"vtable for std::basic_
(
dash::mpd::BasicCMParser::parseCommonAttributesElements(dash::xml::Node*, dash::mpd::CommonAttributesElements*, dash::mpd::CommonAttributesElements*) const in MobileVLCKit(libdash_plugin_la-BasicCMParser.o)
dash::mpd::BasicCMParser::handleDependencyId(dash::mpd::Representation*, dash::mpd::AdaptationSet const*, std::string const&) in MobileVLCKit(libdash_plugin_la-BasicCMParser.o)
dash::mpd::BasicCMParser::resolveUrlTemplates(std::string&, bool&) in MobileVLCKit(libdash_plugin_la-BasicCMParser.o)
dash::mpd::SegmentTemplate::getSourceUrl() const in MobileVLCKit(libdash_plugin_la-SegmentTemplate.o)
dash::mpd::Segment::toChunk() in MobileVLCKit(libdash_plugin_la-Segment.o)
dash::http::PersistentConnection::prepareRequest(dash::http::Chunk*) in MobileVLCKit(libdash_plugin_la-PersistentConnection.o)
libebml::IOCallback::writeFully(void const*, unsigned long) in MobileVLCKit(IOCallback.o)
...
)
there is a note : NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
and at the end of the section :
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
in the very end of the warning message I've get an activity log complete with 80 error :?
thanks for reading
PS : I can't find any .m document I hope It's normal
PS: Yes I open my project in the Workspace created by Cocoapods
Maybe something with CocoaPods file but it looks like your project doesn't have libstdc++ in dependencies. I see it in spec:
xcconfig": {
"CLANG_CXX_LANGUAGE_STANDARD": "c++11",
"CLANG_CXX_LIBRARY": "libstdc++"
}
You need it for C++ code.

Linking Errors while generating SDK

I am trying to generate SDK in that am using audio related framework ,when compiling code am getting below linking errors .Any help for solving these issues.
Undefined symbols for architecture armv7:
"_vDSP_ztoc", referenced from:
FFTRealCalculator::InverseFFT_A(ComplexSplit*, float*, int) in libEywaSDK.a(FFTRealCalculator.o)
"_vDSP_ctoz", referenced from:
FFTRealCalculator::ForwardFFT_A(float const*, unsigned long, ComplexSplit*) in libEywaSDK.a(FFTRealCalculator.o)
"_vDSP_fft_zrip", referenced from:
FFTRealCalculator::ForwardFFT_A(float const*, unsigned long, ComplexSplit*) in libEywaSDK.a(FFTRealCalculator.o)
FFTRealCalculator::InverseFFT_A(ComplexSplit*, float*, int) in libEywaSDK.a(FFTRealCalculator.o)
"_vDSP_create_fftsetup", referenced from:
FFTRealCalculator::Initialize(unsigned char) in libEywaSDK.a(FFTRealCalculator.o)
"_vDSP_destroy_fftsetup", referenced from:
FFTRealCalculator::~FFTRealCalculator() in libEywaSDK.a(FFTRealCalculator.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These symbols come from Accelerate Framework
I suspect you need to add this to your project.
Go to targets -> Valid Architectures & Remove armv7.
Clean your project & build
Hope it will work for you.

Undefined symbols for architecture i386: for OpenCV project

I am trying to build this project, but its display below error,
Undefined symbols for architecture i386:
"cv::merge(std::vector<cv::Mat, std::allocator<cv::Mat> > const&, cv::_OutputArray const&)", referenced from:
-[RRMainViewController colorSobelEdge:isVertical:] in RRMainViewController.o
"cv::split(cv::Mat const&, std::vector<cv::Mat, std::allocator<cv::Mat> >&)", referenced from:
-[RRMainViewController colorSobelEdge:isVertical:] in RRMainViewController.o
"cv::Exception::Exception(int, std::string const&, std::string const&, std::string const&, int)", referenced from:
-[RRMainViewController floodFillPostprocess:WithColor:] in RRMainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have added OpenCV.framework and added this line in .pch file
#ifdef __cplusplus
#import <opencv2/opencv.hpp>
#endif
Added this library in project
libstdc++.6.0.9.dylib
libc++.dylib
libz.1.2.5.dylib
But still got above error.. please help... thanx in advance..
Here is the screenshot for my Build phase
=================================================================
SOLVED
This answer by #karthika has helped me.
Opencv framework or some other files are not added in the build phases. Go to project settings->Build phases->Link binary with libraries and check if opencv exists in the list. Otherwise click on + and add it
Then go in the build phases to compile sources and make sure RRMainViewController.m is present in the list. Otherwise click on + and add it
This answer may help you too: Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

compilation error when using boost framework and opencv in ios project

I need to use boost framework in my iOS project. My first mission was getting boost to work for Ios. I tried using this script
http://goodliffe.blogspot.co.uk/2010/09/building-boost-framework-for-ios-iphone.html
but wasn't able to build due to lipo errors (?) and couldn't figure out how to solve it. I looked for a precompiled framework and came accross this project on github:
https://github.com/danomatika/ofxLua
There is an Ios version of boost included in the lib section. So I tried using it in my project
but now when I build my project I am getting these errors:
Undefined symbols for architecture i386:
"vtable for boost::filesystem::detail::utf8_codecvt_facet", referenced from:
(anonymous namespace)::path_locale() in boost(path.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"_inflate", referenced from:
MatlabIO::uncompressVariable(unsigned int&, unsigned int&, unsigned int&, std::vector<char, std::allocator<char> > const&) in MatlabIO.o
"_inflateEnd", referenced from:
MatlabIO::uncompressVariable(unsigned int&, unsigned int&, unsigned int&, std::vector<char, std::allocator<char> > const&) in MatlabIO.o
"_inflateInit_", referenced from:
MatlabIO::uncompressVariable(unsigned int&, unsigned int&, unsigned int&, std::vector<char, std::allocator<char> > const&) in MatlabIO.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also want to make clear that I installed boost using
sudo port install boost
and under my xcode project I am not linking to /usr/local/include/boost/ or something like that. It seems that it is compiling with incorrect architecture.
Any solution for this? Maybe the framework isn't compiled for Ios? Or is my project not referencing the correct version
You can use the BOOST 1.57.0 with ofxiOSBoost static libraries and headers:
https://github.com/danoli3/ofxiOSBoost
Releases for libc++ (c++11), libstdc++.
All build scripts are in the /scripts folder (updated Peter Goodliffe script)

Resources