我在我的 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/