Skip to content

Include errors when compiling #46

@jmshrv

Description

@jmshrv

Please fill in the following fields:

Pre-built SDK from the website or open-source from this repo: Pre-built SDK
Firebase C++ SDK version: 6.12.0
Firebase plugins in use (Auth, Database, etc.): Storage
Additional SDKs you are using (Facebook, AdMob, etc.): None
Platform you are using the C++ SDK on (Mac, Windows, or Linux): Linux
Platform you are targeting (iOS, Android, and/or desktop): Desktop (Linux)

Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

When I include Firebase Storage in my program, the imported libraries can't find their own imports. I have put the firebase_cpp_sdk directory next to my source file in src/. This is the directory structure of my program:

├── CMakeLists.txt
├── README.md
├── src
│   ├── firebase_cpp_sdk
│   │   ├── Android, frameworks, include, libs etc
│   └── main.cpp

1115 directories, 4058 files

Here is the relevant bit of my main.cpp (nothing else in it relates to Firebase at all):

#include "iostream"
#include "firebase_cpp_sdk/include/app.h"
#include "firebase_cpp_sdk/include/storage.h"

int main(int, char**) {
    // Initialise the Firebase app
    firebase::App * firebaseApp = firebase::App::Create(firebase::AppOptions());
    firebase::storage::Storage* firebaseStorage = firebase::storage::Storage::GetInstance(firebaseApp);

    // Creates a reference to the bucket
    firebase::storage::StorageReference bucketReference = firebaseStorage->GetReferenceFromUrl("gs://arduino-project-234f5.appspot.com");

Here is my CMakeLists.txt, although the same error still occurs when just doing g++ main.cpp:

cmake_minimum_required(VERSION "3.17.0")

project("camera-software")

file(GLOB camera-software_SRC
    "src/*"
)


# Sets the flags to include OpenCV. Should probably remove the unused ones
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/include/opencv -lopencv_core -lopencv_highgui")

add_executable("${PROJECT_NAME}" "${camera-software_SRC}")

install(TARGETS "${PROJECT_NAME}" DESTINATION bin)
install(FILES "main.cpp" DESTINATION src)

Here is the error:

In file included from firebase_cpp_sdk/include/storage.h:23,
                 from main.cpp:4:
firebase_cpp_sdk/include/firebase/storage/controller.h:18:10: fatal error: firebase/storage/storage_reference.h: No such file or directory
   18 | #include "firebase/storage/storage_reference.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions