Qt World Summit: Register Today!

[Solved] Weird Compile Error

  • I've written a Qt GUI application with two UI Designer forms. When I had just the one MainWindow UI form, I didn't have any compiler errors. I then added a second UI, InitWindow, which is a QWidget. When I compile, I get the error: "The build directory needs to be at the same level as the source directory. File not found" The project is called Progress, and all the files associated with the project are in the Progress directory. Why am I getting this error?

  • Your build directory must be located at the same root directory as your source files directory, meaning, if your sources are in the "C:\Projects" directory, your directory structure needs to be like this


    The "Progress-build-desktop" is where your build will be located. Check your build options.

    I had similar issue when upgraded Qt last time, I hope I am not writing absolute nonsense here :D

  • [quote author="Eus" date="1314815491"]I hope I am not writing absolute nonsense here :D[/quote]
    Absolutely not. As the error message clearly states qmake out-of-souce builds require the build directory to be at the same directory level as the source directory.

  • Yeah, that was it. I wonder why my build directory was in a different spot - it's not like I specifically set it.

  • Hi Endless,

    One quick tip to solve this issue
    Actually the build directory variable belongs to the projects user configuration. Say if my project name is MyProject.pro, there will be another file named MyProject.pro.user in the project directory which holds the user specific settings for the project. To fix this issue, you can either edit this file to find the key named Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory and replace it with the correct path you want. Or more conveniently, delete this file and reopen the project. Now a new pro.user file will be generated automatically, and everything will be alright.


Log in to reply