19

I have created an application that compiles and runs like a charm on OS-X. I would now like to start getting it to work on Windows. To start, I copied the project to a windows machine and just tried to compile, but got this error:

:: warning: Qmake does not support build directories below the source directory.

Any ideas?

dombesz
  • 7,890
  • 5
  • 38
  • 47
Jay
  • 2,861
  • 3
  • 29
  • 51

7 Answers7

16

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
  • 4,460
  • 32
  • 45
13

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.

TJM
  • 146
  • 1
  • 2
  • For me the problem was solved by going to 'Projects' in Qt Creator and alter the Build-Path (My Project was first hat %PATH/project/project -> I moved It to %PATH/project but my Build-Path was still %PATH/project/build-project-Desktop[...] --> %PATH/build-project-Desktop[...]) now qmake works and compiling is also no problem. Hope that helps – Martin Sep 03 '13 at 08:23
7

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.

Inverse
  • 4,408
  • 2
  • 26
  • 35
2

.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)

axel22
  • 32,045
  • 9
  • 125
  • 137
gre
  • 21
  • 1
1

Just remove the files with the pro.user extension , worked for me

axel22
  • 32,045
  • 9
  • 125
  • 137
0

I also got this, trying to compile a project created on linux.

Another way to solve it is to change the paths in the .pro.user file (in the directory of your project)

Giova
  • 1
  • It's generally a bad idea to edit an application's internal database. If you *have* to, the application doesn't recover very well from user error (or you really messed up bad, if allowing for your abuse would be cruel and unusual punishment). Just let the IDE make a new copy of the file. – Grault Feb 09 '12 at 06:39
0
  1. Right Click on a project: Set As Active Project
  2. Click on the Projects button (The one with the spanner image)
  3. Edit build configuration : Debug / Profile / Release / and change the default directories, OR just uncheck the Shadow build check box.

    • The Build directory path should now change to black, from red
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142