V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lytofb
V2EX  ›  程序员

C compiler cannot create executables 这个错误应该怎么排错

  •  
  •   lytofb · 2016-07-09 10:35:55 +08:00 · 9600 次点击
    这是一个创建于 2819 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近想在群晖 216play 上安装一下 aria2 ,但是在安装完 bootstrap , ipkg 之后,启动 aria2 的时候出现了如下错误

    Exception: [AbstractOptionHandler.cc:73] errorCode=28 We encountered a problem while processing the option '--seed-ratio'.
    
    -> [OptionHandlerImpl.cc:254] errorCode=1 seed-ratio must be greater than or equal to 0.0.
    

    折腾了半天也没有什么结果,于是乎我又想试试源码编译。结果刚 configure 的时候就遇上了这个错误

    configure: error: C compiler cannot create executables
    See `config.log' for more details
    

    在 config.log 里面是这样的

    #define PACKAGE_NAME "aria2"
    #define PACKAGE_TARNAME "aria2"
    #define PACKAGE_VERSION "1.19.0"
    #define PACKAGE_STRING "aria2 1.19.0"
    #define PACKAGE_BUGREPORT "https://github.com/tatsuhiro-t/aria2/issues"
    #define PACKAGE_URL "http://aria2.sourceforge.net/"
    #define PACKAGE "aria2"
    #define VERSION "1.19.0"
    
    configure: exit 77
    

    后来 google 了一顿发现我就蒙了,感觉 cannot create executables 这个错误有好多种原因,我以前没太接触过 c 的编译,也就是知道 arm 和 x86 的程度,完全不知道该怎么玩了,还求大伙指点一下

    第 1 条附言  ·  2016-07-09 15:32:32 +08:00

    后来重新看了一下日志,发现如下错误

    在 Core tests 里面有这样的错误: 
    /opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: ERROR: /lib/libc.so.6 uses VFP register arguments, a.out does not 
    /opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: failed to merge target specific data of file /lib/libc.so.6 
    
    14 条回复    2016-11-09 16:18:04 +08:00
    nyanyh
        1
    nyanyh  
       2016-07-09 11:02:36 +08:00
    这个 log 是不是不完整啊
    lsmgeb89
        2
    lsmgeb89  
       2016-07-09 11:03:39 +08:00
    查下有没有写目录的权限
    lytofb
        3
    lytofb  
    OP
       2016-07-09 11:23:05 +08:00
    @nyanyh 这个是 config.log 的日志的最后几行,前面的部分也没有报错,不过记录的都是 Platform , Core tests , Cache Variable , Output variables 等类似参数,直到正文里的 log 最后这是 confdefs 部分
    nyanyh
        4
    nyanyh  
       2016-07-09 11:28:16 +08:00   ❤️ 1
    r#3 @lytofb 以前我也遇到过这个错误,但是在 log 里有../gcc-4.6.2/configure: line 4190: -gcc: command not found 这种错误,建议再找一下吧
    lytofb
        5
    lytofb  
    OP
       2016-07-09 11:32:10 +08:00
    @nyanyh 恩,找了一下,确实在 Core tests 里面有这样的错误:
    /opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: ERROR: /lib/libc.so.6 uses VFP register arguments, a.out does not
    /opt/lib/gcc/arm-none-linux-gnueabi/4.2.3/../../../../arm-none-linux-gnueabi/bin/ld: failed to merge target specific data of file /lib/libc.so.6
    单独试了一下用 gcc 编译个 hello world 也出这样的错,看来和 VFP 有关系
    Archangel_SDY
        6
    Archangel_SDY  
       2016-07-09 11:41:19 +08:00
    这不是写得很清楚了么....

    seed-ratio must be greater than or equal to 0.0.
    lytofb
        7
    lytofb  
    OP
       2016-07-09 12:46:02 +08:00
    @Archangel_SDY 问题是这个参数默认就是 1.0 啊,而且即使指定了也会报同样的错
    owt5008137
        8
    owt5008137  
       2016-07-09 14:32:51 +08:00
    config.log 你没贴关键的信息,搜一下里面的 error ,然后找到最后出错的位置附近的 log 。只贴最后一部分没用啊
    RecursiveG
        9
    RecursiveG  
       2016-07-09 16:54:52 +08:00
    lytofb
        10
    lytofb  
    OP
       2016-07-09 18:32:39 +08:00
    @RecursiveG 谢谢,这个我也看了,但是说实话这方面基础不好看不太懂说的啥

    问题也解决了,群晖 216play 可以使用 pbhub 上的 bootstrap installer 来安装 bootstrap ,我就是通过这个第三方套件重新安装了 bootstrap 解决了最根本的 aria2 报错问题,同时 c 的编译也正常了,看来所有问题的起因都是安装了错误的 bootstrap 导致的
    dishonest
        11
    dishonest  
       2016-11-09 14:30:07 +08:00
    @lytofb 请问下具体怎么操作吗,我的也是 216play
    lytofb
        12
    lytofb  
    OP
       2016-11-09 14:36:02 +08:00
    @dishonest 看 10 楼,里面讲的挺清楚的。比较傻瓜的解决办法就是用群晖的应用商店里的 bootstrap installer 来安装对应的 bootstrap 即可
    dishonest
        13
    dishonest  
       2016-11-09 16:12:29 +08:00
    @lytofb 找到了,这个源叫做 cphub =.=b 您写错了。。
    lytofb
        14
    lytofb  
    OP
       2016-11-09 16:18:04 +08:00
    @dishonest 哈哈,不好意思哈,应该是 cphub
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3233 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 67ms · UTC 12:16 · PVG 20:16 · LAX 05:16 · JFK 08:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.