Skip to content
Rıza Sabuncu edited this page Sep 17, 2022 · 23 revisions

Please always make environment variables persistent if you override them.

You can do this by either editing your $HOME/.bash_profile or $HOME/.profile on macOS or Linux.

Don't forget to run source $HOME/.bash_profile or source $HOME/.profile afterwards.

On Windows you can simply use the advanced system settings or setx NAME "VALUE".

Don't forget to restart the command prompt to get the new environment variables.

General environment variables

You usually won't need to override these, only if you install Qt in a custom location or if you want to test a different version of Qt.

Variable Default Type Note
QT_DIR $HOME/Qt(5.13.0) or C:\Qt(5.13.0) string should point to the root dir of your Qt installation; can also be temporary set by using the -qt_dir flag
QT_VERSION 5.13.0 string can be used to link against a specific Qt version; can also be temporary set by using the -qt_version flag
QT_API 5.13.0 string can be used to generate code for a specific Qt version; can also be temporary set by using the -qt_api flag

Special purpose environment variables

You will only need to override these very rarely, so you can probably ignore them for now.

Variable Default Type Note
QT_DEBUG false bool set this to true if you want to print the called Qt function names at runtime (warning: very verbose; you may need to re-run the setup with this being set to make it work)
QT_DEBUG_CONSOLE false bool set this to true to enable the console output for Windows builds
QT_STUB false bool can be set to true to make the binding installation possible on machines with less than 2GB RAM or on 32-bit systems
QT_QMAKE_DIR string can be used to make use of custom versions of Qt

Go 1.10.x specific environment variables (newer and older versions should not be affected)

If you use Go 1.10.x you will need to export these environment variables for go build or go run to work

CGO_CFLAGS_ALLOW=".*" 
CGO_CXXFLAGS_ALLOW=".*" 
CGO_LDFLAGS_ALLOW=".*" 

Now that you are done with the environment variables you can start with the installation:

Installation on Windows

Installation on macOS

Installation on Linux

Clone this wiki locally