Thread: changing the gcc standard include search path

  1. #1
    char main() RoshanX's Avatar
    Join Date
    Mar 2003
    Posts
    68

    changing the gcc standard include search path

    Hi all,

    Is there a way to change where GCC will look for glibc header files ( defult: /usr/include , /usr/local/include ...) ? is there a way to change the spec file and archive this ?
    ( I want to do this without using ENV variables and/or -I switch ).

    Thank you!
    First there was God. He was quite lonely, so he created Dennis.
    Dennis was unimpressed with God.
    So, . . . God created Brian..........Khan Klatt
    http://www.clifford.at/fun/GOD

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Code:
    `-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.
    > ( I want to do this without using ENV variables and/or -I switch ).
    Short of rebuilding your compiler, I don't think you can.

    The switch above allows you to turn off all the standard paths, so you can specify your own. If it worries you that much, write a shell script wrapper around gcc.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help me with function call
    By NeMewSys in forum C++ Programming
    Replies: 16
    Last Post: 05-22-2008, 01:53 PM
  2. C programing doubt
    By sivasankari in forum C Programming
    Replies: 2
    Last Post: 04-29-2008, 09:19 AM
  3. precompiled header file
    By George2 in forum C++ Programming
    Replies: 20
    Last Post: 04-07-2008, 08:14 AM
  4. Kdevelop compiler search path
    By eth0 in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2004, 11:12 AM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM