Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Setting environment variable when debugging via "Start and debug external application"
Moschops last edited by
I have a (set of inter-related) projects that I develop and debug through QT Creator, but do not build using QT Creator. Everything was great until the code changed and now there needs to be an environment variable set when the executable begins.
I can set environment variables in "Project -> Run Settings", but it seems that when I start the process through "Start and debug external application" those environment variables aren't used. My standard terminal takes its env vales from my ~/.bashrc, which contains the necesary environment variable, but it seems that starting via "Start and debug external application" runs the executable in an environment that does NOT contain the needed environment variable, even when I tick the box for "Run in terminal".
Is there a way to specify the environment variables when starting a process through "Start and debug external application"?
Interesting question, you should also try asking in on the qt-creator mailing list. You'll find there Qt Creator's developers/maintainers
andreyc last edited by
One of the option maybe to start an app through a shell script
export MYTEST="Hello, world!"
Select this script in "Local Executable" files and run it.