简体   繁体   English

如何在qmake中设置预编译头文件夹的名称?

[英]How to set the name of the precompiled headers folder in qmake?

I am writing a cross-platforms desktop application using qt creator as an IDE.我正在编写一个使用 qt creator 作为 IDE 的跨平台桌面应用程序。 Today, I started working on the Linux port of the application and encountered a problem related to qmake.今天开始做应用程序的Linux端口,遇到了一个qmake相关的问题。

On Windows, qmake creates the folder TARGET which contains the precompiled headers and next to it, TARGET.exe the application executable.在 Windows 上,qmake 创建文件夹 TARGET,其中包含预编译的头文件,旁边是 TARGET.exe 应用程序可执行文件。

On Linux however, both the folder and the executable have the same name TARGET causing the linker to fail creating the executable.然而,在 Linux 上,文件夹和可执行文件都具有相同的名称 TARGET,导致链接器无法创建可执行文件。

The only workaround that I can think of is manually specifying the precompiled headers folder name.我能想到的唯一解决方法是手动指定预编译头文件夹名称。

The question is, how to do this?问题是,如何做到这一点?

在这里找到解决方案:使用未记录的变量PRECOMPILED_DIR来设置创建的 pch 的输出目录。

You can make an temporary folder and call from that folder "qmake ../Your_pro_file.pro" and then just call "make".您可以创建一个临时文件夹并从该文件夹调用“qmake ../Your_pro_file.pro”,然后调用“make”。 Does it work ?它有效吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM