当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 使用arm-linux-gcc编译sqlite3报错
帖子发表于 : 2016-08-02 10:31 

注册: 2015-08-12 9:12
帖子: 15
系统: ubuntu
送出感谢: 4
接收感谢: 0 次
编译sqlite3首先编译ncurses、readline这两个库,在编译的时候遇到以下问题,求解答
(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$

编译ncurses-6.0:
代码:
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

编译sqlite-autoconf-3130000:
代码:
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


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 使用arm-linux-gcc编译sqlite3报错
帖子发表于 : 2016-08-02 11:09 
头像

注册: 2011-03-20 13:12
帖子: 4552
地址: 山东省寿光县
系统: Debian
送出感谢: 106
接收感谢: 1009
hh_L 写道:
(arm-linux-gcc已加入到path路径中,编译普通.c文件没有问题)
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

--host=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc 改为 --host=arm-fsl-linux-gnueabi
另根据情况设置环境变量
export CROSS_COMPILE=/opt/arm/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi
export CC=${CROSS_COMPILE}-gcc
export LD=${CROSS_COMPILE}-ld
export AS=${CROSS_COMPILE}-as
......
......

另参考 https://how-to-build-for-arm.wikispaces.com/ncurses


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户



_________________
评价: 3.7% hh_L
 
页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译