Reputation: 869
I want to integrate Cocos2dx v4 cpp project with Firebase (I am using firebase_cpp_sdk_8.11.0). This has been successfully integrated in Android. The problem that I am facing right now is integrate with IOS (without Pod). I already followed this link https://medium.com/firebase-developers/how-to-use-firebase-in-ios-games-written-in-c-fef1a6a9f87d and official Google Firebase tutorial but still failed.
The step that I did was:
cocos new CocosFirebase -p <com.your_company.your_game> -l cpp -d .
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/firebase_cpp_sdk)
target_link_libraries(${APP_NAME}
firebase_analytics
firebase_messaging
firebase_app
)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIROptions", referenced from:
objc-class-ref in libfirebase_app.a(app_ios.mm.o)
"_OBJC_CLASS_$_FIRConfiguration", referenced from:
objc-class-ref in libfirebase_app.a(app_ios.mm.o)
"_OBJC_CLASS_$_UNUserNotificationCenter", referenced from:
objc-class-ref in libfirebase_messaging.a(messaging.mm.o)
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in libfirebase_app.a(app_ios.mm.o)
"_OBJC_CLASS_$_FIRMessaging", referenced from:
objc-class-ref in libfirebase_messaging.a(messaging.mm.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 also tried to link the library needed as stated in here Firebase Undefined symbols for architecture x86_64 but no luck. Or tried also to link directly inside the xcframework that provided from firebase cpp sdk.
Please note that I have successfully integrate with Android, and due to complexity and issue with Pod, I would like to integrate directly since Firebase also provide CPP SDK.
Any help will be much appreciated. Thanks.
Upvotes: 0
Views: 221
Reputation: 1
I have exactly the same issue with my project using the Qt framework.
It looks like you're only using the firebase-cpp SDK.
This issue seems to be relative : https://github.com/firebase/firebase-cpp-sdk/issues/19
You might miss the native FirebaseIOS libs which the firebase-cpp-sdk wraps: https://firebase.google.com/download/ios
Upvotes: 0