Difference in relative file path: debug mode and release mode of Qt Creator

让人想犯罪 __ 提交于 2019-12-05 23:25:17

This depends on current working directory of your program. You can change it in Project->Run settings->Run->Working directory.

if I execute the release program through Qt Creator, the working directory will work just like what you said. But if I directly click the .exe in the release folder, the situation will be as what I said in the question.

This is because when you click the .exe in the release foder, that folder is the working directory for the program. When you run the program from Qt Creator, Qt Creator sets the working directory explicitly. You may override the Working directory to be the directory where .exe file is created so it'll be no difference whether you run the program from Qt Creator or just click the .exe in Explorer.

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