Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Global Includes Path

Tags:

c++

linux

I am trying to use OpenBabel and am experiencing great difficulty with setting up a global search path for include files. I have successfully linked to the libraries with $LD_LIBRARY_PATH, but when compiling with the GNU C++ compiler, it cannot find the include files. Is there a global include environment variable on Linux, and if so, what is it?

like image 815
BWHazel Avatar asked Nov 10 '10 01:11

BWHazel


Video Answer


1 Answers

You could give the include path to GCC using the option -I:

g++ -I/path/to/the/include/dir blabla

Please note that also the library dir may be bassed via -L option -L/path/to/lib/dir. LD_LIBRARY_PATH is usually considered a dirty hack.

You can have multiple -I (and -L) options:

g++ -I/dir/include1 -I/dir/include2
like image 184
peoro Avatar answered Sep 28 '22 21:09

peoro