0

I'm willing to create subfolders in Qt Creator, using answers from the following thread :

How to create a folder or a subdirectory for a project in QtCreator?

I created a folder in my explorer, then renamed my existing file "folder/existingFile.cpp". (I also did it for the header .h) The file is successfully show in the hierarchy under the new folder. I cleaned the project, run qmake.

At compilation the following error is thrown:

No rule to make target "[...]/existingFile.cpp" needed by 'qrc_app.cpp'. Stop.

Is my make file generated by qmake corrupted ?

What am I doing wrong ?

Ps : I tried the .pri approach suggested in the thread (.pri in subfolder, including it in the .pro) without success.

Greg
  • 579
  • 5
  • 26
  • 2
    I think you have removed a file imported in your resources file (.qrc). – Dimitry Ernot Mar 05 '19 at 15:25
  • Thanks, It did the trick ! Renaming the file does not remove it from the app.qrc, but moves it in new folder; resulting in compilation error because path changed. You rocks ! – Greg Mar 05 '19 at 15:36

1 Answers1

1

A Qt resources file (*.qrc) is a XML file containing the paths to your resources. It isn't automatically updated when you move/delete files outide the Qt resource editor.

So, when you delete a file without removing it from the resource file, the build will still try to embed it and will fail.

Dimitry Ernot
  • 6,256
  • 2
  • 25
  • 37