Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

After using 'Duplicate file' menu, the new file does not compile



  • I duplicated a CPP file and its H, renamed the class, and consumed this new class in the program.
    Now that I build, I get linker errors for the constructor of this class being unresolved.
    I checked the PRO file and the new class is included at the end of SOURCES and HEADERS, but there is no compiled OBJ in the build directory (Debug in this case).
    Any ideas why the new file does not compile and the build progresses all the way to linking?

    If I right click on any of the files in the project and select Build, they compile and the output shows. On this file, there is an error:

    20:54:35: Starting: "C:\Qt\Qt5.11.3\Tools\QtCreator\bin\jom.exe" -f Makefile.Debug debug/OpenCLTester.obj
    Error: Target debug/OpenCLTester.obj doesn't exist.
    

    Does this mean that every time a file is duplicated, Qmake has to be run?


  • Lifetime Qt Champion

    @In-Fo said in After using 'Duplicate file' menu, the new file does not compile:

    Does this mean that every time a file is duplicated, Qmake has to be run?

    Yes, because else makefiles will not be regenerated.


Log in to reply