Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Weird Compile Error
Forum Updated to NodeBB v4.3 + New Features

[Solved] Weird Compile Error

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 4 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Endless
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Robbin
      wrote on last edited by
      #2

      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

      C:\Projects\Progress
      C:\Projects\Progress-build-desktop

      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

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Endless
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • S Offline
            S Offline
            subin
            wrote on last edited by
            #5

            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.

            Thanks

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved