0

我将gflags集成为vcpkg 包,vcpkg 建议我可以根据此链接 gflags。

1> [CMake] The package gflags provides CMake targets:
1> [CMake] 
1> [CMake]     find_package(gflags CONFIG REQUIRED)
1> [CMake]     target_link_libraries(main PRIVATE gflags_shared gflags::gflags_shared)

我既不能链接gflags::gflags_shared。这给了我这个错误。

1> [CMake] CMake Error at C:/lib/vcpkg/scripts/buildsystems/vcpkg.cmake:578 (_add_library):
1> [CMake]   Target "my_lib" links to target "gflags::gflags_shared"

我也不能尝试将其静态链接。这条线find_package(gflags REQUIRED COMPONENTS static)会给我以下 cmake 错误。

1> [CMake] CMake Error at out/build/x64-windows/share/gflags/gflags-config.cmake:40 (message):
1> [CMake]   Package gflags was installed without required component static!

知道我做错了什么吗?

4

0 回答 0