您的位置:首页 > 运维架构 > Linux

linux下通过编写测试程序的方式来确认arm-linux-gnueabihf-gcc-4.6lib和.h文件的安装位置,为复制libnl做准备

2015-03-06 15:27 941 查看
在命令端口输入

# arm-linux-gnueabihf-gcc -4.6 -v 查看到

Using built-in specs.

COLLECT_GCC=arm-linux-gnueabihf-gcc-4.6

COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper

Target: arm-linux-gnueabihf

Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/arm-linux-gnueabihf/include/c++/4.6.3 --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --disable-werror --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include
--with-headers=/usr/arm-linux-gnueabihf/include --with-libs=/usr/arm-linux-gnueabihf/lib

Thread model: posix

gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

看了半天也看明白arm-linux-gnueabihf-gcc-4.6 的lib和.h文件是否装在红色字体显示的文件夹中,测试

在任何目录下创建一个hello.c文件

#include "stdio.h"

#include "hello.h"

void main(void)

{

int a;

a = wangbinbin;

printf("%d \n",a);

}

usr/arm-linux-gnueabihf/include 下创建一个对应hello.h文件,为

#ifndef __Hell_

#define __Hell_

#define wangbinbin 15

#endif

在命令行输入#arm-linux-gnueabihf-gcc-4.6 hello.c

正常编译通过,说明确实在次目录下,同理那么lib文件就应该在/usr/arm-linux-gnueabihf/lib下了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐