在Solaris10上使用g++进行64位编译

64 bit compilation using g++ on Solaris10

本文关键字:进行 64位 编译 g++ Solaris10      更新时间:2023-10-16

我正试图在Solaris10上使用g++的共享安装来编译一个测试cpp代码,但它仅在32位模式下编译。

/tools/gnu/bin/g++ -v
Reading specs from /tools/gnu/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/tools/gnu/bin/g++ -g -m64 ~/test9.cpp
cc1plus: -m64 is not supported by this configuration
cc1plus: -mptr32 not allowed on -m64

uname -aimnprsvX
SunOS md1sisun26 5.10 Generic_141444-09 sun4v sparc sun4vSystem = SunOS
Node = md1sisun26
Release = 5.10
KernelID = Generic_141444-09
Machine = sun4v
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 8

你能建议我在这里应该给我什么选项来生成64位二进制文件吗?

谢谢Niraj Rathi

Solaris上的

gcc 2.95.2不支持-m64。您需要升级编译器。

这条信息也可能会提供一些见解。

看起来您有一个32位版本的Solaris。。。你可以用测试我是否属实

/usr/bin/isainfo -kv