【问题标题】:Compiling 32bit with 64bit g++ Fedora用 64 位 g++ Fedora 编译 32 位
【发布时间】:2017-03-11 21:05:23
【问题描述】:

当我尝试编译我的代码时:

g++ -m32 code.cpp

我收到一个错误:

/usr/bin/ld: 搜索 -lstdc++ 时跳过不兼容的 /usr/lib/gcc/x86_64-redhat-linux/6.2.1/libstdc++.so /usr/bin/ld: 找不到 -lstdc++ collect2:错误:ld 返回 1 个退出状态

我已经安装了:

gcc-6.2.1-2.fc24.x86_64

gcc-c++-6.2.1-2.fc24.x86_64

glibc-devel-2.23.1-10.fc24.i686

libstdc++-devel-6.2.1-2.fc24.x86_64

如何解决?

【问题讨论】:

    标签: compilation g++ 32bit-64bit fedora


    【解决方案1】:

    我的解决方案是:

    sudo dnf install libstdc++-static libstdc++-static.i686
    

    但你可能还需要

    sudo dnf install libstdc++-devel libstdc++-devel.i686
    

    【讨论】:

      猜你喜欢
      • 2011-04-23
      • 2011-04-12
      • 1970-01-01
      • 2018-08-04
      • 2017-01-21
      • 2013-08-25
      • 1970-01-01
      • 2017-06-09
      • 1970-01-01
      相关资源
      最近更新 更多