C++ Solaris 10 SPARC 64上的Protobuf-2.6.1编译错误
在Solaris 10 SPARC 64上尝试编译Protobuf-2.6.1时,我得到:C++ Solaris 10 SPARC 64上的Protobuf-2.6.1编译错误,c++,gcc,solaris-10,protobuf-c,pointer-conversion,C++,Gcc,Solaris 10,Protobuf C,Pointer Conversion,在Solaris 10 SPARC 64上尝试编译Protobuf-2.6.1时,我得到: ./google/protobuf/stubs/once.h: In function `void google::protobuf::GoogleOnceInit(google::protobuf::ProtobufOnceType*, void (*)())': ./google/protobuf/stubs/once.h:125: error: cannot convert `google::pro
./google/protobuf/stubs/once.h: In function `void google::protobuf::GoogleOnceInit(google::protobuf::ProtobufOnceType*, void (*)())':
./google/protobuf/stubs/once.h:125: error: cannot convert `google::protobuf::ProtobufOnceType*' to `const volatile google::protobuf::internal::Atomic32*' for argument `1' to `google::protobuf::internal::Atomic32 google::protobuf::internal::Acquire_Load(const volatile google::protobuf::internal::Atomic32*)'
./google/protobuf/stubs/once.h: In function `void google::protobuf::GoogleOnceInit(google::protobuf::ProtobufOnceType*, void (*)(Arg*), Arg*)':
./google/protobuf/stubs/once.h:134: error: cannot convert `google::protobuf::ProtobufOnceType*' to `const volatile google::protobuf::internal::Atomic32*' for argument `1' to `google::protobuf::internal::Atomic32 google::protobuf::internal::Acquire_Load(const volatile google::protobuf::internal::Atomic32*)'
我遵循官方自述,/configure
和make
编译器版本(GCC):
我也读了这个问题,试了试,但没有成功。该文章适用于Protobuf-2.4.1,但Protobuf-2.6.1发生了变化:
2014-10-20 version 2.6.1:
C++
* Added atomicops support for Solaris.
有没有办法让GCC进行强制指针转换?我根据github问题解决了这个问题 主要原因在本问题的第四点。预定义的启用SOLARIS_64位_的宏完全无效 只需向CXXFLAGS和CFLAGS添加
-m64-dsolais\u 64位\u ENABLED
即可解决此问题。但最好按照问题的建议进行整体修改
2014-10-20 version 2.6.1:
C++
* Added atomicops support for Solaris.