getting g++ to search correct include directory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles Herman

    getting g++ to search correct include directory

    I am using the following flags for the g++ command

    -I/usr/local/gcc-3.3/include/c++/3.3 -I/usr/local/include/g++-3

    But istead of searching the first directory first, it searches the second
    directory first. When I interchange the directories, it still searches
    /usr/local/include/g++-3 first. How can I force it to search in the order I
    want?

    When I do not include any -I flag in the g++ commnand, it searches only
    /usr/local/gcc-3.3/include/c++/3.3

    -charles

  • Jacek Dziedzic

    #2
    Re: [OT] getting g++ to search correct include directory

    Basically, you're not in the right newsgroup.




    People here are very sensitive about posts being on-topic,
    so trying a g++-specific newsgroup is your only major option.

    - J.


    Comment

    • Gianni Mariani

      #3
      Re: getting g++ to search correct include directory [OT]

      Charles Herman wrote:[color=blue]
      > I am using the following flags for the g++ command
      >
      > -I/usr/local/gcc-3.3/include/c++/3.3 -I/usr/local/include/g++-3
      >
      > But istead of searching the first directory first, it searches the second
      > directory first. When I interchange the directories, it still searches
      > /usr/local/include/g++-3 first. How can I force it to search in the order I
      > want?
      >
      > When I do not include any -I flag in the g++ commnand, it searches only
      > /usr/local/gcc-3.3/include/c++/3.3
      >
      > -charles
      >[/color]

      This is a standard C++ NG. Nothing to do with g++ specifics.

      BTW - the problem you might be having is that g++ will look in a few
      standard places before it starts looking at -I's. You can change that
      behaviour by:



      -nostdinc
      Do not search the standard system directories for
      header files. Only the directories you have specified
      with -I options (and the directory of the current
      file, if appropriate) are searched.

      -nostdinc++
      Do not search for header files in the C++-specific
      standard directories, but do still search the other
      standard directories. (This option is used when
      building the C++ library.)

      ....

      all available with a "man g++" !


      Comment

      • Default User

        #4
        Re: getting g++ to search correct include directory

        Charles Herman wrote:[color=blue]
        >
        > I am using the following flags for the g++ command[/color]


        Try:

        gnu.g++.help



        Brian Rodenborn

        Comment

        Working...