g++ search path

K

kramer31

Hi. Can anyone tell me how to find the g++ search path (for include
files)? I run Gentoo Linux 2.6.

Thanks.
 
G

Gianni Mariani

kramer31 said:
Hi. Can anyone tell me how to find the g++ search path (for include
files)? I run Gentoo Linux 2.6.

This is OT for this NG - try a GCC forum next time.

This is what MakeXS uses:

$ touch _my__jnk.cpp
$ g++ -Wp,-v -c _my__jnk.cpp
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i6
86-pc-cygwin/include"
ignoring duplicate directory
"/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686
-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include
/usr/include
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api
End of search list.


The MakeXS macro is like this:
MXS_GEN_STDINCLUDEDIRS_X=$(dir $(addsuffix /a,$(shell touch
_my__jnk.cpp; $(CXX) -Wp,-v -c _my__jnk.cpp 2>&1 | grep " /" ; rm -f
_my__jnk.* ) ) )

It creates a single list of dirs like so in gmake.

/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/
/usr/lib/gcc/i686-pc-cygwin/3.4.4
/include/c++/i686-pc-cygwin/
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/ /usr/include/
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/

There may be easier ways of doing this so you really should ask the GCC
fellas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top