码迷,mamicode.com
首页 > 其他好文 > 详细

交叉工具链在编译应用程序时,如何查找默认的头文件路径

时间:2018-01-31 11:31:19      阅读:1087      评论:0      收藏:0      [点我收藏+]

标签:tor   code   tty   arm   sub   blog   exec   red   number   

默认的搜索路径是通过在ubuntu-12.04的shell窗口输入如下命令显示:

echo ‘main(){}‘|arm-linux-gcc -E -v - 
  • 1

比如说我的路径显示则如下:

Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/lite-respin/linux/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion=‘Sourcery G++ Lite 2008q3-72‘ --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/lite-respin/linux/obj/host-libs-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/lite-respin/linux/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) 
COLLECT_GCC_OPTIONS=‘-march=armv4t‘ ‘-E‘ ‘-v‘
 /usr/local/arm-4.3.2/4.3.2/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.2/cc1 -E -quiet -v -imultilib armv4t -iprefix /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/ -isysroot /usr/local/arm-4.3.2/4.3.2/bin/../arm-none-linux-gnueabi/libc - -march=armv4t
ignoring nonexistent directory "/usr/local/arm-4.3.2/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/local/include"
ignoring duplicate directory "/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/../../lib/gcc/arm-none-linux-gnueabi/4.3.2/include"
ignoring duplicate directory "/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/../../lib/gcc/arm-none-linux-gnueabi/4.3.2/include-fixed"
ignoring duplicate directory "/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/../../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/include
 /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/include-fixed
 /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/include
 /usr/local/arm-4.3.2/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
main(){}
COMPILER_PATH=/usr/local/arm-4.3.2/4.3.2/bin/../libexec/gcc/arm-none-linux-gnueabi/4.3.2/:/usr/local/arm-4.3.2/4.3.2/bin/../libexec/gcc/:/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/
LIBRARY_PATH=/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/:/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/lib/armv4t/:/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/:/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/:/usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/lib/:/usr/local/arm-4.3.2/4.3.2/bin/../arm-none-linux-gnueabi/libc/armv4t/lib/:/usr/local/arm-4.3.2/4.3.2/bin/../arm-none-linux-gnueabi/libc/armv4t/usr/lib/
COLLECT_GCC_OPTIONS=‘-march=armv4t‘ ‘-E‘ ‘-v‘
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27

其中的下面这一段就代表着arm-linux-gcc在编译文件时所搜索的头文件路径:

#include "..." search starts here:
#include <...> search starts here:
 /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/include
 /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/include-fixed
 /usr/local/arm-4.3.2/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/include
 /usr/local/arm-4.3.2/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include

库文件搜索路径:

LIBRARY_PATH=/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/:/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/lib/armv4t/:/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/:/usr/local/arm/4.3.2/bin/../lib/gcc/:/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/lib/:/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/armv4t/lib/:/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/armv4t/usr/lib/



海思平台的交叉工具链的搜索路径

#include <...> search starts here:
/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/include
/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/include-fixed
/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/include
/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../target/usr/include

 

库文件搜索路径 

COMPILER_PATH=/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../libexec/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../libexec/gcc/:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/bin/
LIBRARY_PATH=/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../lib/gcc/arm-hisiv100-linux-uclibcgnueabi/4.4.1/../../../../arm-hisiv100-linux-uclibcgnueabi/lib/:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../target/lib/:/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../target/usr/lib/

 



交叉工具链在编译应用程序时,如何查找默认的头文件路径

标签:tor   code   tty   arm   sub   blog   exec   red   number   

原文地址:https://www.cnblogs.com/zhengAloha/p/8390718.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!