Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot compile individual .cpp files in Qt Creator with imported CMake build
Forum Updated to NodeBB v4.3 + New Features

Cannot compile individual .cpp files in Qt Creator with imported CMake build

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 136 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 on last edited by Robert Hairgrove
    #1

    When I build a project using qmake, compiling a single source file I had just edited always worked by simply right-clicking on the file in the Projects list and selecting "Build" from the context menu.

    I built another project (not my own) using the cmake build system which I had cloned from their GitLab hosting site. I built it first successfully from the command line using just cmake, then imported the top-level CMakeFiles.txt into Qt. It parses and builds everything successfully when I build the whole project.

    However, after editing a single file, for eample named xyz.cpp, and trying to just compile it as described above, I get the error:

    :-1: error: No rule to make target 'xyz.cpp.o'.  Stop.
    

    Is there another way to do this? Otherwise, I have to wait several minutes for CMake to go through the whole build process just for one file.

    I am using Qt Creator 4.12.2 on Linux Ubuntu 18.04.4 with GCC version 7.5.0. It is a KDE5 project which provides its own Qt libraries which are version 5 (not sure about the minor version number, though). My local Qt installation is 5.12.9, but this isn't used by that project.

    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