View default include path of C headers in Mac OS X by `gcc -v`?

后端 未结 1 2001
谎友^
谎友^ 2020-12-07 14:59

I tried to find the default include path of the C compiler in Mac OS X (Mavericks) by using gcc -v:

$ gcc -v
Configured with: --prefix=/Applicat         


        
相关标签:
1条回答
  • 2020-12-07 15:25

    You need to ask the preprocessor, not gcc, for telling the default include path.

    You can say:

    `gcc -print-prog-name=cc1` -v
    

    In order to list default include path for both C and C++:

    `gcc -print-prog-name=cc1plus` -v
    

    (The path that you've listed above is the one that was used to configure GCC while building.)


    Another way to list the default include path would be:

    gcc -x c -v -E /dev/null
    
    gcc -x c++ -v -E /dev/null     # (for C/C++)
    
    0 讨论(0)
提交回复
热议问题