c++ - GLOG - flags.cc' is being linked both statically and dynamically into this executable - Stack Overflow
CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(siriusx-infer CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# ------------------------------------
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
find_package(GTest CONFIG REQUIRED)
find_package(glog CONFIG REQUIRED)
# ------------------------------------
aux_source_directory(siriusx/src/base/ DIR_BASE)
# ------------------------------------
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
# ------------------------------------
add_library(llama SHARED ${DIR_BASE})
target_link_libraries(llama PUBLIC GTest::gtest_main GTest::gtest glog::glog)
target_include_directories(llama PUBLIC ${glog_INCLUDE_DIR})
target_include_directories(llama PUBLIC ${PROJECT_SOURCE_DIR}/siriusx/include)
add_subdirectory(test)
test/CMakeLists.txt
find_package(GTest CONFIG REQUIRED)
find_package(glog CONFIG REQUIRED)
aux_source_directory(../test DIR_TEST)
aux_source_directory(../test/test_example DIR_TEST_EXAMPLE)
# aux_source_directory(../test/test_tensor DIR_TEST_TENSOR)
add_executable(my_test
${DIR_TEST}
${DIR_TEST_EXAMPLE}
# ${DIR_TEST_TENSOR}
)
target_link_libraries(my_test PUBLIC GTest::gtest_main GTest::gtest glog::glog)
target_include_directories(my_test PUBLIC
${glog_INCLUDE_DIR}
${GTest_INCLUDE_DIR}
../siriusx/include
)
target_link_directories(my_test PUBLIC ${PROJECT_SOURCE_DIR}/lib)
# target_link_libraries(my_test PUBLIC llama)
when i want to add the last line target_link_libraries(my_test PUBLIC llama)
,some issues have arisen.
ERROR: something wrong with flag 'timestamp_in_logfile_name' in file '/Users/moguw/.vcpkg/buildtrees/glog/src/v0.7.1-795557b621.clean/src/flags'. One possibility: file '/Users/moguw/.vcpkg/buildtrees/glog/src/v0.7.1-795557b621.clean/src/flags' is being linked both statically and dynamically into this executable.
i have close my miniconda, and compiler the dynamic library, but as a C++ beginner, i have no more ideas
最新文章
- 安卓之父曾遭三星高管嘲笑:你们喝醉了吗
- 微软每年从安卓厂商获20亿美元专利费
- laravel - Filament | Processing Attachment using API through Email via SendGrid - Stack Overflow
- delphi - How to set up the properties of the ScrollBars of a TStringGrid? - Stack Overflow
- open source - Langgraph State not being passed properly with Ollama - Stack Overflow
- HTML code for removing lines when using slices for email signature that has multiple hyperlinks - Stack Overflow
- java - Custome Recipe Parsing Error when developing mod with fabric in Minecraft 1.21.4 - Stack Overflow
- javascript - How can you use a React hook conditionally in a function component - Stack Overflow
- swift - When does appleExerciseTime update or change? - Stack Overflow
- How to switch flutter project on Android studio 2021.2.1 from my windows machine to android studio ladybug on my mac through Git
- Flutter - individual bloc states - Stack Overflow
- graph theory - Algorithm to find a subgraph that includes all vertices, ensures single connection failure tolerance, and minimiz
- oauth 2.0 - how Can we add group roles claim in okta access token or id token - Stack Overflow
- Why is my bot not able to detect when a user leaves in Telegram? - Stack Overflow
- android - How call Authenticator.authenticate with custom respond in okhttp? - Stack Overflow
- GitHub disallow merge and rebase commits for multiple repositories - Stack Overflow
- java - YubiKey PIV AuthenticationDecryption returns 0x6A80 error - Stack Overflow