Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add extra include/lib paths to MinGW

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?

like image 819
delaccount992 Avatar asked Dec 27 '10 08:12

delaccount992


People also ask

How do I add a path to MinGW?

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.


2 Answers

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

like image 113
Piotr Dobrogost Avatar answered Oct 26 '22 22:10

Piotr Dobrogost


Use -Idirective for extra includes and -Ldirective for extra library paths such as:

g++ [...] -I C:\qt\include -L C:\qt\lib

You can use multiple -Iand -Loptions.

like image 26
ismail Avatar answered Oct 26 '22 22:10

ismail