0

How to establish the connection with Firebase in my Veins project? I have downloaded the Firebase C++ SDK and imported it into my Veins project. However, I'm not sure how to configure my project to enable adding and retrieving data from Firebase .

  1. I have imported the Firebase SDK into my project.
  2. i try this code :
include <veins/modules/application/ieee80211p/Internet.h>
#include "veins/firebase_cpp_sdk/include/firebase/app.h"
#include "veins/firebase_cpp_sdk/include/firebase/auth.h"
#include "veins/firebase_cpp_sdk/include/firebase/database.h"
void Internet::init(){

      firebase::AppOptions options;
       
        options.set_api_key("297209001490");
        options.set_database_url("https://my-app-veins-m2-rsd-default-rtdb.firebaseio.com/");
        firebase::App* app = firebase::App::Create(options);
        firebase::database::Database* database = firebase::database::Database::GetInstance(app);
      
}
  1. But it displays this error :

undefined reference to `firebase::App::Create(firebase::AppOptions const&)'

undefined reference to `firebase::database::Database::GetInstance(firebase::App*, firebase::InitResult*)'

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
malika
  • 21
  • 2
  • 1
    Have you read the documentation, specially on how to link with the libraries since it looks like a linker problem. The error states it cannot find an implementation (definition) of the functions you try to call. – Pepijn Kramer May 16 '23 at 08:11

0 Answers0