"Undefined symbols for architecture arm64" when using Firebase C++ sdk - c++

I downloaded the firebase c++ sdk, 10 jun 2016.
I added the sdk into my iOS project, set the -objc into the other linker flags. And i got a linker error
PLease advice.
The error log is as follows:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in libapp.a(app_ios_efc96a6f6f98f7443dddf841f7396489.o)
"_OBJC_CLASS_$_FIROptions", referenced from:
objc-class-ref in libapp.a(app_ios_efc96a6f6f98f7443dddf841f7396489.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(EDIT 1)
Framework search path:
$(PROJECT_DIR)/ios/Libs/Firebase
The firebase is in the folder and the includes and the .a libraries.

My problem when I got the same error was that I did not include the iOS SDK along with the C++ library. I did not realize that the C++ library DEPENDS on iOS SDK.
I thought that the the C++ library is a whole new code base that provides the potential for cross-platform development. However, you are still bound to only iOS or Android, but you can choose to code in C++ so you could reuse the C++ code in iOS and Android.

Related

libzip external library inclusion in xcode project

Currently I am including an external library in my xcode project. I have included the libraries manually in my project, so I am able to get all the library function. There is no any compile time errors, but when I am running I am getting runtime error somewhat like mentioned bellow
Undefined symbols for architecture x86_64:
"_zip_error_to_str", referenced from:
Greeting::Greeting() in Myzipclass.o
"_zip_open", referenced from:
Greeting::Greeting() in Myzipclass.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've included libzip libraries in to my project.
More details: I haven't included any framework. Is it necessary to include framework? I am totally new in xcode. If it is necessary to include framework then can anyone tell me procedures to include? I mean, should it be inside the project?
Just concluded from the error info, See if static library libz.1.X.X.dylib have been added to xcode. Otherwise,
targets--->build phases----->link binary with libraries-----> add libz

Non-sense error Undefined symbols for architecture armv7

I've built a 32 bit library that is a requirement to my project. Here's its lipo info:
LP:lib hcabral$ lipo -info Release-iphoneos/librmservices_iphone.a
input file Release-iphoneos/librmservices_iphone.a is not a fat file
Non-fat file: Release-iphoneos/librmservices_iphone.a is architecture: armv7
I link the library in my project, it shows up in "Link Binary with binaries", etc., and yet I get this error:
Undefined symbols for architecture armv7:
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
xpath::YaccParser::getObjectPointer(uft::Value*&, bool) in librmservices_iphone.a(xpath_yacc.o)
xpath::YaccParser::performLexicalAnalysis(uft::Value*&) in librmservices_iphone.a(xpath_yacc.o)
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
xpath::Context::removeDynamicContext(uft::Value const&) in librmservices_iphone.a(xpath_context.o)
"_kCFProxyPasswordKey", referenced from:
DLProxySettingsController::getSystemProxySettings() in librmservices_iphone.a(DLProxySettingsController.o)
"_kCFNetworkProxiesHTTPProxy", referenced from:
(...)
All the projects I limited to armv7 and no solution. Any ideas?
So, I have a project A that is pure Objective-C, but it depends on a Project B that is C/C++ and Objective-C, and happens to be 32-bit code only.
Up until Mavericks and Xcode 5.1.1, I built Project B for all platforms (Release and Debug for iOS and i386) in order to debug, run tests and eventually deploy. Project B has its own set of linker flags and options that make it very special.
In project A, I would link the binaries of Project B (libProjectB.a) and it has always worked.
However, during this last iteration, Project A build process complained about missing symbols for armv7, which confused me, because project B is compiled ONLY in armv7 and i386.
The only way I manage to remove 30+ linking errors, was by linking the following frameworks:
libstdc++.6.0.9.dylib
CoreText.framework
CFNetwork.framework
Foundation.framework
I hope these don't look like random frameworks to you, but I found out by adding one by one, based on the type of linking error. For example, I added the CFNetwork only after opening the C++ code and noticing that the symbols would be part of it.
Anyway, again, I don't know why it happened yet, but it happened by using Yosemite and Xcode 6.1. Hope this can shed a light on someone.

How to install ZeroMQ on Mac OS X 10.9 for use in a C/C++ program

I'm trying to receive information from an 0MQ Socket in C or C++, but therefore I have to include zmq.h. By downloading the 0MQ software from their website and including this file. Xcode gives the following error:
Undefined symbols for architecture x86_64:
"_zmq_init", referenced from:
_main in main.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 installing ZeroMQ using brew I get the same error. Is there anyone who know a workaround?
The problem here is that you aren't linking the ZMQ library correctly.
You need to build the library once you've downloaded it (they include all the make scripts you need). Once you have that, you will need to link them to the compiler. I'm not too familiar with XCode, but using gcc it would look something like this:
-L/path/to/zmq/library -lzmq
ZeroMQ is really beautiful though. I've used it on Linux/Windows. Hope you get it working!

Apple Mach-O Linker Error with upnpx library

I am having a small problem when using the upnpx library.
I have downloaded the library and opened the upnpdemo workspace. I created in the same workspace a new project to try to create a simple app with this library. I set the parameters like a demo project, but XCode returns 21 errors:
Apple Mach-O Linker Error
Undefined symbols for architecture i386:
"std::string::find(char const*, unsigned long) const", referenced from:
In your new project's build settings, set the C++ Language Dialect and C++ Standard Library to Compiler Default for both of them.
If you build upnpx.a with
**C++ Language Dialect** GNU++11[-std=gnu++11]
**C++ Standard Library** libc++ (LLVM C++ standard library with C++11 support)
In your project you must
iOS Deployment Target 7.0 or above
If you get upnpx.a from web, you can try to lower the Deployment target, 6.
And DO NOT FORGET
**Other Linker Flags**: -lstdc++

Running Qt libraries from Xcode 4

It is well known that the current version of Qt doesn't allow to convert the project to xcode4 project http://bugreports.qt-project.org/browse/QTBUG-17247. Anyways, at least in theory, it should be possible to compile something in xcode by linking the proper Qt libraries (either dynamic or static), right?
I have taken one Qt 4.7.4 example: "Hello world" and copy/paste the source code into my main. I included the proper headers /QtSDK/Desktop/Qt/473/gcc/include/**. Then I added the three frameworks QtScript, QtCore, QtGui. The linker still gives me errors:
Undefined symbols for architecture x86_64:
"qInitResources_helloscript()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
I also tried to link with all the libraries in /QtSDK/Desktop/Qt/473/gcc/include/ but still no luck. Also tried with other Qt creator examples, but I get all other sorts of linker errors.