g++ search path

Discussion in 'C++' started by kramer31, Jul 29, 2007.

  1. kramer31

    kramer31 Guest

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

    Thanks.
     
    kramer31, Jul 29, 2007
    #1
    1. Advertising

  2. kramer31 wrote:
    > 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.
     
    Gianni Mariani, Jul 29, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith-Earl
    Replies:
    1
    Views:
    2,024
    Peter O'Reilly
    May 3, 2004
  2. Replies:
    0
    Views:
    2,290
  3. Mupota Muchelemba
    Replies:
    1
    Views:
    949
    Tony Morris
    Feb 4, 2004
  4. Matt
    Replies:
    3
    Views:
    19,716
    Sudsy
    Jul 8, 2004
  5. Abby Lee
    Replies:
    5
    Views:
    473
    Abby Lee
    Aug 2, 2004
Loading...

Share This Page