Qt Creator: When I enable Shadow Builds, why do I get error related to missing files?

余生长醉 提交于 2019-12-24 22:05:15

问题


I added an image to resources, and displaying it worked fine. Then, I removed the file from resources in the Qt project, and I moved the file to a new images folder and re-added it to resources.

Now the project will only compile if "Shadow Build" option is un-checked in build settings.

If Shadow Build is enabled, I receive an error,

"No rule to make target '../--project_name--/--image_name--', needed by 'debug/qrc_qml.cpp'. Stop."

where --project_name-- is the name of my project, etc.

This error doesn't make much sense, considering the file no longer exists at that location. What's going on here?


回答1:


The answer is to run qmake. This can be done from Build->run qmake. Qmake regenerates makefiles, which 'build' and 'build all' do not. The problem is that references to the file at its old location were not being removed by rebuilding. Credit to Andrii for pointing to answer in comment above.



来源:https://stackoverflow.com/questions/46647849/qt-creator-when-i-enable-shadow-builds-why-do-i-get-error-related-to-missing-f

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!