Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator not picking up changes to .cpp files, will not build unless I first clean the project?
Qt 6.11 is out! See what's new in the release blog

Qt Creator not picking up changes to .cpp files, will not build unless I first clean the project?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 1 Posters 64 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.
  • R Offline
    R Offline
    Robert Hairgrove
    wrote last edited by Robert Hairgrove
    #1

    Using Qt Creator 19.0.0 on Linux Ubuntu 24.04 (gcc_64) from revision 99d590c8c9:

    I was used to making little changes in a source file and then right-clicking the single file in the "Project" view, then choose "Build" from the context menu which should register that the file had changed and then re-compile the selected source file.

    Now, when I do the same, and after I save the file, I get this in the "Compile" output (for example, I want to compile "MySource.cpp"):

    make: Nothing to be done for '.obj/MySource.o'
    

    It isn't picking up the changes I just made.

    I consider this to be a bug ... does anyone have a workaround, or knows about a setting in "Preferences" which I can set to revert to the old behavior?

    (EDIT: In my qmake project file, I have set a custom OBJECTS_DIR which is why there is a subfolder .obj/ in the compiler output)

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Robert Hairgrove
      wrote last edited by
      #2

      The plot thickens...

      I cleaned out the entire build directory, including what I thought might have been a stale .qmake.stash file. After building everything successfully from scratch, I introduced an error by intentionally misspelling one of the variables in a function in MySource.cpp. Tried to compile that single file and got the same error as reported above.

      So I corrected the error, right-clicked once more on the file name in the "Projects" view, and now I have this error:

      :-1: error: No rule to make target '.obj/MySource.o'.  Stop.
      

      Once again, I click on the main "Build" icon on the bottom left, and everything successfully compiles and links. I tried to make a minimal project to reproduce the error, but I cannot pin it down. It doesn't seem to have anything to do with the presence of the OBJECTS_DIR variable. It could be that the source file is in a subproject of the main project which has TEMPLATE=subdirs. But the subproject is TEMPLATE=app. And this did work for many years (i.e. compiling a single file from the "Projects" view context menu). Something has broken recently.

      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