且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在64位机器上编译64位的C ++程序?

更新时间:2021-09-27 02:52:08

-m32 只能来自你makefile中的某个地方,你必须跟踪它(使用递归grep)并删除它。

-m32 can only be coming from somewhere in your makefiles, you'll have to track it down (use a recursive grep) and remove it.


当我能够强制-m64,我得到你选择的CPU不支持x86-64指令集。任何线索? uname -a给x86_64

When I am able to force -m64, I get "CPU you selected does not support x86-64 instruction set".Any clues?. uname -a gives x86_64

这个错误意味着有一个选项 -march = i686 $ c

That error means there is an option like -march=i686 in the makefiles, which is not valid for 64-bit compilation, try removing that too.

如果你不能删除它(更努力!),那么在makefile中的$ c>在命令行后添加 -march = x86-64 将指定一个通用的64位CPU类型。

If you can't remove it (try harder!) then adding -march=x86-64 after it on the command line will specify a generic 64-bit CPU type.