链接Firebase C ++(分析)库时出错

时间:2016-12-17 23:34:33

标签: android c++ qt firebase

我正在尝试使用Firebase C ++库(2.0.0 / 2.1.0)在Qt(Android和iOS)应用程序中构建分析支持。当我的应用程序被链接时,我收到以下错误:

config/production.rb

我错过了什么?

我包含以下标题(遵循GitHub中的示例)

  config.action_cable.url = 'wss://api.skill.guide/cable'
  config.action_cable.disable_request_forgery_protection = true

在我的pri文件中链接libapp.a和libanalytics.a:

blaze-out/arm-linux-androideabi-4.8-bionic-armv7a-opt/genfiles/firebase/app/client/cpp/include/firebase/variant.h:533: error: undefined reference to 'firebase::Variant::assert_is_type(firebase::Variant::Type) const'
blaze-out/arm-linux-androideabi-4.8-bionic-armv7a-opt/genfiles/firebase/app/client/cpp/include/firebase/variant.h:543: error: undefined reference to 'firebase::Variant::assert_is_type(firebase::Variant::Type) const'
blaze-out/arm-linux-androideabi-4.8-bionic-armv7a-opt/genfiles/firebase/app/client/cpp/include/firebase/variant.h:553: error: undefined reference to 'firebase::Variant::assert_is_type(firebase::Variant::Type) const'
blaze-out/arm-linux-androideabi-4.8-bionic-armv7a-opt/genfiles/firebase/app/client/cpp/include/firebase/variant.h:567: error: undefined reference to 'firebase::Variant::assert_is_string() const'
firebase/analytics/client/cpp/src/analytics_android.cc:228: error: undefined reference to 'firebase::Variant::TypeName(firebase::Variant::Type)'
collect2: error: ld returned 1 exit status

我让AdMob示例在类似的设置中工作 - 但我无法构建分析...

1 个答案:

答案 0 :(得分:4)

证明链接顺序很重要。

在libapp.a之前链接libanalytics.a并且它可以正常工作

LIBS += -L$$FIREBASE_SDK_LIBS_PATH -lanalytics
LIBS += -L$$FIREBASE_SDK_LIBS_PATH -lapp

(我先把app连接起来)