20250809 16:54记录
问题描述
来自于GitCode - 全球开发者的开源社区,开源代码托管平台
的代码遇到以下错误:
D:\Proj\qt\ElfParser\elfparser-master\CMakeLists.txt:32: error: The keyword signature for target_link_libraries has already been used with
the target "elfparser". All uses of target_link_libraries with a target
must be either all-keyword or all-plain.
The uses of the keyword signature are here:
* D:/Qt/Qt6/6.9.1/msvc2022_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:640 (target_link_libraries)
解决方法
加多一行文字 PRIVATE ,见下面位置
target_link_libraries(elfparser
PRIVATE
Qt6::Core
Qt6::Widgets
)