I would like to add some extra include/lib directories besides the default ones for MinGW to search upon compilation. The reason for this is because the hard drive I currently have MinGW installed into is nearly full and so I had to install Qt into my second one instead. Thus, how can I have MinGW include the Qt files by default?
In the Windows search bar, type 'settings' to open your Windows Settings. Search for Edit environment variables for your account. Choose the Path variable in your User variables and then select Edit. Select New and add the Mingw-w64 destination folder path to the system path.
You can set environment variables CPLUS_INCLUDE_PATH
for include directories and LIBRARY_PATH
for library directories. More information can be found in Environment Variables Affecting GCC
Use -I
directive for extra includes and -L
directive for extra library paths such as:
g++ [...] -I C:\qt\include -L C:\qt\lib
You can use multiple -I
and -L
options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With