添加 TEMPLATE=subdirs 时 QT Creator 无法构建
我是 QT Creator 的新手。我想创建一个带有 exe 和静态库的 QT 项目。
如果我首先创建 exe 项目,它对于每个构建配置都可以正常构建/重建。
但是,当我将 TEMPLATE = subdirs 添加到 .pro 文件末尾时,它会停止正确构建。但看来有必要将静态库添加到项目中。知道我可能做错了什么吗?
谢谢。
I'm new to QT Creator. I want to create a QT project with an exe and a static lib.
If I create the exe project first, it builds/rebuilds fine for every build configuration.
However, when i add TEMPLATE = subdirs
to the end of the .pro file it stops building correctly. But it appears that is necessary to add static libs to the project. Any idea what I may be doing wrong?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个想法是在顶层创建一个 TEMPLATE = subdirs 的 .pro 文件,然后将可执行文件放在一个子目录中,将库放在另一个子目录中。将两个目录添加到 SUBDIRS。
据我所知,使用 qmake 来构建某些东西并在一个 .pro 文件中递归是不可能的。
我不确定 Qt Creator 支持,但手动创建 TEMPLATE = subdirs .pro 文件很容易。
The idea is to have a .pro file with TEMPLATE = subdirs on the toplevel and then the executable in one subdirectory and the library in another. Add both directories to SUBDIRS.
AFAIK it is not (easily) possible with qmake to build something and also recurse in one .pro file.
I am not sure about Qt Creator support, but it is easy to create the TEMPLATE = subdirs .pro file by hand.
编辑:
抱歉,我不明白你要做什么,你能解释得更好吗?
这有帮助吗:
来自此处
edit:
I'm sorry, I did not understand what you are trying to do, can you explain better?
Does this help:
from here