私はThriftを初めて使用しています:http://thrift.apache.org/ 私はCentOSを使用していて、恐らくThriftをインストールしています。私は倹約を使ってコードを生成することができます。 しかし、指示に従います:http://wiki.apache.org/thrift/ThriftUsageC%2B%2B Something_server.cppをコンパイル中にエラーが発生しました。 理由を知るためにplsが助けてくれることを知っています。何も思いつきません。ありがとうございましたThriftサーバのコンパイル中にエラーが発生しました
私はPHPを使ってC++を呼び出すためにC++だけができる仕事をするようにしました。 誰かが私のために別の提案をしていますか?ありがとう、あなたが不足しているhtons()、htonl()関数に問題があるかのように
[[email protected] gen-cpp]# g++ -Wall -I/usr/local/include/thrift *.cpp -lthrift -o something /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI16(int16_t)â: /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:147: error: there are no arguments to âhtonsâ that depend on a template parameter, so a declaration of âhtonsâ must be available /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:147: error: (if you use â-fpermissiveâ, G++ will accept your code, but allowing the use of an undeclared name is deprecated) /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI32(int32_t)â: /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:154: error: there are no arguments to âhtonlâ that depend on a template parameter, so a declaration of âhtonlâ must be available Something_server.cpp: In member function âvirtual int32_t SomethingHandler::ping()â: Something_server.cpp:28: warning: no return statement in function returning non-void /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI16(int16_t) [with Transport_ = apache::thrift::transport::TTransport]â: /usr/local/include/thrift/protocol/TVirtualProtocol.h:401: instantiated from âuint32_t apache::thrift::protocol::TVirtualProtocol::writeI16_virt(int16_t) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT, Super_ = apache::thrift::protocol::TProtocolDefaults]â Something_server.cpp:42: instantiated from here /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:147: error: âhtonsâ was not declared in this scope /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI32(int32_t) [with Transport_ = apache::thrift::transport::TTransport]â: /usr/local/include/thrift/protocol/TVirtualProtocol.h:405: instantiated from âuint32_t apache::thrift::protocol::TVirtualProtocol::writeI32_virt(int32_t) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT, Super_ = apache::thrift::protocol::TProtocolDefaults]â Something_server.cpp:42: instantiated from here /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:154: error: âhtonlâ was not declared in this scope /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::readI16(int16_t&) [with Transport_ = apache::thrift::transport::TTransport]â: /usr/local/include/thrift/protocol/TVirtualProtocol.h:499: instantiated from âuint32_t apache::thrift::protocol::TVirtualProtocol::readI16_virt(int16_t&) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT, Super_ = apache::thrift::protocol::TProtocolDefaults]â Something_server.cpp:42: instantiated from here /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:362: error: ântohsâ was not declared in this scope /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::readI32(int32_t&) [with Transport_ = apache::thrift::transport::TTransport]â: /usr/local/include/thrift/protocol/TVirtualProtocol.h:503: instantiated from âuint32_t apache::thrift::protocol::TVirtualProtocol::readI32_virt(int32_t&) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT, Super_ = apache::thrift::protocol::TProtocolDefaults]â Something_server.cpp:42: instantiated from here /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:373: error: ântohlâ was not declared in this scope /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI16(int16_t)â: /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:147: error: there are no arguments to âhtonsâ that depend on a template parameter, so a declaration of âhtonsâ must be available /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:147: error: (if you use â-fpermissiveâ, G++ will accept your code, but allowing the use of an undeclared name is deprecated) /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI32(int32_t)â: /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:154: error: there are no arguments to âhtonlâ that depend on a template parameter, so a declaration of âhtonlâ must be available Something_server.skeleton.cpp: In member function âvirtual int32_t SomethingHandler::ping()â: Something_server.skeleton.cpp:28: warning: no return statement in function returning non-void /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI16(int16_t) [with Transport_ = apache::thrift::transport::TTransport]â: /usr/local/include/thrift/protocol/TVirtualProtocol.h:401: instantiated from âuint32_t apache::thrift::protocol::TVirtualProtocol::writeI16_virt(int16_t) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT, Super_ = apache::thrift::protocol::TProtocolDefaults]â Something_server.skeleton.cpp:42: instantiated from here /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:147: error: âhtonsâ was not declared in this scope /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::writeI32(int32_t) [with Transport_ = apache::thrift::transport::TTransport]â: /usr/local/include/thrift/protocol/TVirtualProtocol.h:405: instantiated from âuint32_t apache::thrift::protocol::TVirtualProtocol::writeI32_virt(int32_t) [with Protocol_ = apache::thrift::protocol::TBinaryProtocolT, Super_ = apache::thrift::protocol::TProtocolDefaults]â Something_server.skeleton.cpp:42: instantiated from here /usr/local/include/thrift/protocol/TBinaryProtocol.tcc:154: error: âhtonlâ was not declared in this scope /usr/local/include/thrift/protocol/TBinaryProtocol.tcc: In member function âuint32_t apache::thrift::protocol::TBinaryProtocolT::readI16(int16_t&) [with Transport_ = apache::thrift::transport::TTransport]â:
私は同じボートにあります - CentOS、Thrift build from source – selvin