With Eclipse: How to add include paths and libraries for all your C/C++ project

后端 未结 8 1928
闹比i
闹比i 2020-12-17 09:33

Is it possible to add include paths and libraries to all C/C++ projects? In others words: How can I make them global or copy one C/C++ project build setting to another one?<

8条回答
  •  爱一瞬间的悲伤
    2020-12-17 09:55

    I often use the CPATH environment variable to include different directories across all my projects. It's found under: c/c++->build->environment. Be sure to separate each path with a ':' character (not a ';' semicolon).

    You can also use PATH to include static libs. However, for me it's only worked reliably in linux. In OSX it ruins make.

    The alternative would be to add these libraries and headers to your environments default search paths; place likes /usr/local/lib. Read up on where your linker searches by default.

提交回复
热议问题