c++ - GCC:抱歉,未实现:64 位模式未编译

标签 c++ gcc

我在我的 x86 32 位 linux 系统上构建了 GCC 4.7。当我尝试使用 -m64 标志进行交叉编译时,我得到以下信息:

sorry, unimplemented: 64-bit mode not compiled in

而我的 Linux 发行版默认提供的编译器可以与 -m64 交叉编译。

我必须将什么传递给 ./configure 才能在 GCC 中启用 64 位模式?这些是我用来构建 GCC 4.7 的选项:

$ /usr/local/bin/g++ -v Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure --enable-multiarch --with-cloog=/usr/local/ --with-mpfr=/usr/local/ --with-ppl=/usr/local/ --verbose --enable-languages=c,c++
Thread model: posix gcc version 4.7.0 20120113 (experimental) (GCC)

编辑:

--enable-multilib and --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu

不要改变现状。编译器仍然提示 64 位模式未编译:

$ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ./configure --enable-multiarch --with-cloog=/usr/local/ --with-mpfr=/usr/local/ --with-ppl=/usr/local/ --verbose --enable-languages=c,c++ --enable-multilib --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu Thread model: posix gcc version 4.7.0 20120113 (experimental) (GCC)

$ g++ -m64 c.cpp c.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in

最佳答案

This typically means that you're using the wrong (old) compiler.

新的编译器同时支持 -m32 和 -m64。您必须将 PATH 设置为新编译器(在 Rtools 的 gcc、MinGW 子目录中) Rtools 中的任何旧编译器之前。

尝试将编译器的二进制库路径更新为 64 位版本。 lib 文件夹等其他资源也应相应更改。

关于c++ - GCC:抱歉,未实现:64 位模式未编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8861105/

相关文章:

c++ - 如何摆脱结构的数据成员之间的填充字节

c++ - 如何在我的 g++ 编译器中满足 C++ 标准版本?

c++ - "bitwise or"有时工作

c++ - 内联常量函数

c++ - 如何访问OpenCV图像的所有 channel

c - 使用 mingw32 在 Windows 上构建 glew 时 `DllMainCRTStartup@12' 的多个定义

c++ - -fsanitize=address 使用 clang++ 与 g++ 的不同输出

Make 中的 C 编译错误,但不是 GCC/G++

c++ - 32 位 GCC 中的结构打包不起作用?

c++ - 桌面和移动之间的可移植 gpgpu 工具