Add extra include/lib paths to MinGW

2019-02-03 08:55发布

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?

2条回答
手持菜刀,她持情操
2楼-- · 2019-02-03 09:22

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.

查看更多
ら.Afraid
3楼-- · 2019-02-03 09:36

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

查看更多
登录 后发表回答