把build directory清空,或者把上面的shadow build取消勾选,重新加载工程就OK了
Just remove the files with the pro.user
extension , worked for me
.pro.user
are generated files by Qt Creator. They are unrelated to qmake
and should not be touched (and not put into a VCS for that matter)
Don't copy your project.pro.user file when you are copying a project from one machine to another, or from one directory to another. When you open the project, Qt Creator will offer to create a new build directory in the proper place.
Set the shadow build directory to some folder on the same level of your project directory:
folder/ project/ project-shadow-build-release/ project-shadow-build-debug/
You can do this in the "Projects" view, via the toolbar on the left. To me, this warning was just an annoyance, a project never failed to build because of it.
Andref gave the correct answer to resolve this warning, but you may want to understand why this requirement exists.
In fact, the build directory must be at the same folder level as the project (i.e. it can't be above or below). The reason why is that the linker is called from the build directory. Hence, any relative paths to library files will be different than what you entered in your project file.
It kinda sucks. I like to put all intermediate files in their own folder. But you simply can't with qmake.