(arm-linux-gcc已加入到path路径中,编译普通.c文件没有问题)
编译普通源文件:
代码: 全选
lixingliang@lixingliang:~/code/c$ cat 30.c
#include <stdio.h>
int main(void)
{
int a[8] = {1, 3, 5, 7, 9, 11, 13, 15};
int i, j, k;
for(i = 0; i<8; i++)
for(j = 0; j < 8; j++)
for(k = 0; k < 8; k++)
{
if(a[i]+a[j]+a[k] == 30)
printf("%d %d %d\n",a[i], a[j], a[k]);
}
return 0;
}
lixingliang@lixingliang:~/code/c$ arm-fsl-linux-gnueabi-gcc 30.c -o 30
lixingliang@lixingliang:~/code/c$
代码: 全选
lixingliang@lixingliang:~/下载/ncurses-6.0$ sudo ./configure --host=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc --prefix=/opt/arm/arm-sqlite3/
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking for egrep... grep -E
Configuring NCURSES 6.0 ABI 6 (Tue Aug 2 09:56:04 CST 2016)
checking for package version... 6.0
checking for package patch date... 20150808
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc': machine `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi' not recognized
configure: error: /bin/sh ./config.sub /opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc failed
代码: 全选
lixingliang@lixingliang:~/下载/sqlite-autoconf-3130000$ sudo ./configure --host=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc --prefix=/opt/arm/arm-sqlite3/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc-gcc... gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc': machine `/opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi' not recognized
configure: error: /bin/bash ./config.sub /opt/arm/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc failed