QtCreator - 编译问题 - 外部源文件

QtCreator - Compiling issue - External source files

我有一个 Qt 项目,正在访问我光盘上的另一个 cross-platform (boost) 项目。添加 header 包含似乎不会造成任何问题。

#include "../../Visual Studio 2015/Projects/..." //Header file down the road

将现有的源文件添加到我的 Qt 项目中的源文件夹也没有问题,找到了文件并且我可以打开它们。我相信这些文件没有正确编译 - 如果有的话 - 因为我收到链接器错误,告诉我 %sourcefile%.obj 无法打开。 (未创建)

LNK1104: cannot open file 'debug\Error.obj'

我尝试将 Error.cpp 的内容复制到 Qt 项目目录中创建的新 .cpp 文件中。之后错误消息跳转到下一个源文件。我现在可以对所有源文件执行此操作,但这似乎很……不方便。原来工程的改动不会影响Qt工程。

有人知道这个问题/找到解决方案了吗?

我已经检查过 question, answer and comments,但这似乎并没有修复错误或改变任何东西。

解决方案很简单,但有点奇怪。在 *.pro 文件中使用带有 Qt include(...)SOURCES 的带空格的路径时,似乎出现了问题。

//This apparently works and source files are compiled.
include(C:/ProjDir/ProjName.pri)

//This works too, but the source files are not being compiled.
include("../../Visual Studio 2015/Projects/ProjDir/ProjName.pri")

感谢 JKSH on the Qt-Forums and Sebastian 使用 .pri 文件的提示。