首页 > 其他分享 >QT配置cmake 报错:Cannot specify link libraries for target " XXX XXX " which is not built by th

QT配置cmake 报错:Cannot specify link libraries for target " XXX XXX " which is not built by th

时间:2022-12-08 10:55:42浏览次数:35  
标签:already target XXX libraries 报错 link

报错 Cannot specify link libraries for target " XXX XXX " which is not built by this project
是因为在使用target_link_libraries的时候,没有放到add_executable后面.
然而qt项目中的cmakelist.txt已经自动帮你写过add_executable了,所以如果自己加上add_executable又会报错有同名文件被添加。
image
特别注意一个项目中所有链接库要么都是Private要么都不是,如蓝色框框所示,否则会报错
The keyword signature for target_link_libraries has already been used with the target

标签:already,target,XXX,libraries,报错,link
From: https://www.cnblogs.com/Los1r/p/16965476.html

相关文章