[Question] Cannot link with Auth on Linux
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cmake, cpp
- Lĩnh vực
- authentication, build-system, operating-systems
Hướng nghiên cứu
Bắt đầu với CMakeLists.txt và demo.cpp được cung cấp, sau đó tái hiện bản build Linux bằng Firebase SDK 12.7.0 và kiểm tra lệnh linker được tạo ra. Theo dõi các target firebase_app và firebase_auth cùng các symbol chưa được phân giải của chúng; issue được hoàn tất khi demo tối thiểu được liên kết thành công mà không có tham chiếu chưa được định nghĩa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[REQUIRED] Please fill in the following fields:
- Pre-built SDK from the website or open-source from this repo: YES
- Firebase C++ SDK version: 12.7.0
- Main Firebase Components in concern: Auth
- Other Firebase Components in use: App
- Platform you are using the C++ SDK on: Linux
- Platform you are targeting: Desktop
[REQUIRED] Please describe the question here:
I'm trying out the SDK on Linux, and while I accomplished creating a basic demo with the app module, I'm not able to link properly the auth module using the prebuilt libs.
The error I'm getting is a lot of undefined references and I'm not sure why. Shouldn't they be available in the provided .a files?
[main] Building folder: /home/david/data_ssd/Dev/CPP/firebase-demo/build
[build] Starting build
[proc] Executing command: /usr/bin/cmake --build /home/david/data_ssd/Dev/CPP/firebase-demo/build --config Debug --target all -j 14 --
[build] [ 50%] Linking CXX executable firebase-demo
[build] /usr/bin/ld: /home/david/Downloads/firebase_cpp_sdk_12.7.0/firebase_cpp_sdk/libs/linux/x86_64/cxx11/libfirebase_auth.a(9b788918c2ba0e0ffaefa78515169526_auth_desktop.cc.o): in function `firebase::auth::Auth::DestroyPlatformAuth(firebase::auth::AuthData*)':
[build] auth_desktop.cc:(.text+0x3ace): undefined reference to `firebase::internal::FunctionRegistry::UnregisterFunction(firebase::internal::FunctionId)'
[build] /usr/bin/ld: auth_desktop.cc:(.text+0x3ae3): undefined reference to `firebase::internal::FunctionRegistry::UnregisterFunction(firebase::internal::FunctionId)'
[build] /usr/bin/ld: auth_desktop.cc:(.text+0x3af5): undefined reference to `firebase::internal::FunctionRegistry::UnregisterFunction(firebase::internal::FunctionId)'
[build] /usr/bin/ld: auth_desktop.cc:(.text+0x3b0a): undefined reference to `firebase::internal::FunctionRegistry::UnregisterFunction(firebase::internal::FunctionId)'
[build] /usr/bin/ld: auth_desktop.cc:(.text+0x3b1f): undefined reference to `firebase::internal::FunctionRegistry::UnregisterFunction(firebase::internal::FunctionId)'
[build] /usr/bin/ld: /home/david/Downloads/firebase_cpp_sdk_12.7.0/firebase_cpp_sdk/libs/linux/x86_64/cxx11/libfirebase_auth.a(9b788918c2ba0e0ffaefa78515169526_auth_desktop.cc.o):auth_desktop.cc:(.text+0x3b34): more undefined references to `firebase::internal::FunctionRegistry::UnregisterFunction(firebase::internal::FunctionId)' follow
[build] /usr/bin/ld: /home/david/Downloads/firebase_cpp_sdk_12.7.0/firebase_cpp_sdk/libs/linux/x86_64/cxx11/libfirebase_auth.a(9b788918c2ba0e0ffaefa78515169526_auth_desktop.cc.o): in function `firebase::auth::Auth::DestroyPlatformAuth(firebase::auth::AuthData*)':
[build] auth_desktop.cc:(.text+0x3c91): undefined reference to `firebase::app::secure::UserSecureManager::~UserSecureManager()'
[build] /usr/bin/ld: /home/david/Downloads/firebase_cpp_sdk_12.7.0/firebase_cpp_sdk/libs/linux/x86_64/cxx11/libfirebase_auth.a(9b788918c2ba0e0ffaefa78515169526_auth_desktop.cc.o): in function `firebase::auth::InitializeUserDataPersist(firebase::auth::AuthData*)':
[build] auth_desktop.cc:(.text+0x58e8): undefined reference to `firebase::internal::CreateAppIdentifierFromOptions[abi:cxx11](firebase::AppOptions const&)'
[build] /usr/bin/ld: auth_desktop.cc:(.text+0x594b): undefined reference to `firebase::app::secure::UserSecureManager::~UserSecureManager()'
...
[build] clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[build] gmake[2]: *** [CMakeFiles/firebase-demo.dir/build.make:99: firebase-demo] Error 1
[build] gmake[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/firebase-demo.dir/all] Error 2
[build] gmake: *** [Makefile:91: all] Error 2
[proc] The command: /usr/bin/cmake --build /home/david/data_ssd/Dev/CPP/firebase-demo/build --config Debug --target all -j 14 -- exited with code: 2
[driver] Build completed: 00:00:00.227
[build] Build finished with exit code 2
Demo below:
CMakeLists.txt
cmake_minimum_required(VERSION 3.10.0)
project(firebase-demo VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(FIREBASE_SDK_PATH "/home/david/Downloads/firebase_cpp_sdk_12.7.0/firebase_cpp_sdk")
set(TARGET_EXE_NAME "firebase-demo")
add_subdirectory(${FIREBASE_SDK_PATH} firebase_sdk)
add_executable(${TARGET_EXE_NAME} demo.cpp)
set(FIREBASE_LIBS
firebase_app
firebase_auth
)
target_link_libraries(${TARGET_EXE_NAME} PUBLIC ${FIREBASE_LIBS})
target_include_directories(${TARGET_EXE_NAME} INTERFACE "${FIREBASE_SDK_PATH}/include")
demo.cpp
#include "firebase/app.h"
#include "firebase/auth.h"
int main() {
firebase::App *app = firebase::App::Create(firebase::AppOptions());
firebase::auth::Auth *auth = firebase::auth::Auth::GetAuth(app);
return 0;
}
- Ngôn ngữ chính
- C++
- Star
- 326
- Fork
- 138
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-cpp-sdk
-
[FR] Support desktop Linux on aarch64/arm (#error Unknown Linux architecture in app_common.cc)Đang mởnew type: question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
firebase/firebase-cpp-sdk#1926 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
firebase/firebase-cpp-sdk#1905 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
api: firestore
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
firebase/firebase-cpp-sdk#1920 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
firebase/firebase-cpp-sdk#1904 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
new type: question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
firebase/firebase-cpp-sdk#1892 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firebase/firebase-cpp-sdk
Issue tương tự
-
area/actorsystem bug tsan
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
ydb-platform/ydb#54282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
project-chip/connectedhomeip#74434 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
tenstorrent/tt-metal#58057 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
maplibre/maplibre-native#4690 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-query-execution
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ClickHouse/ClickHouse#122569 ·
Maintainer thường phản hồi trong vòng 1 ngày