Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6991955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:34:20+00:00 2026-05-27T19:34:20+00:00

I am new to Thrift : http://thrift.apache.org/ I am using CentOS, and maybe install

  • 0

I am new to Thrift : http://thrift.apache.org/
I am using CentOS, and “maybe” install Thrift succesfully. I can use thrift to generate codes.
But Follow the instruction: http://wiki.apache.org/thrift/ThriftUsageC%2B%2B
I get the Error while compile the Something_server.cpp
Someone know pls help me to find out the reason. I have no idea. Thank you very much

I use thrift to let PHP to call C++ to do a job that only C++ can do.
Any one have another suggestion for me ? Thank you

[root@localhost 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]â:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:34:20+00:00Added an answer on May 27, 2026 at 7:34 pm

    seems as though you have a problem with htons(), htonl() functions missing, have you included the correct header?

    #include <arpa/inet.h>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to WCF, but familiar with COM+ - can I wrap a WCF service
New to soap, I've used soapUI ( http://www.soapui.org ) to test the service I
New to python, competent in a few languages, but can't see a 'snazzy' way
I want to write PHP based thrift API client like thirft.apache.org example client in
I'm new to java and have written a small, but quite important, thrift service
I'm using Apache Thrift server written on Java. When i'm create ServerSocket i'm pass
New to javascript/jquery and having a hard time with using this or $(this) to
New to both Ruby and Rails but I'm book educated by now (which apparently
New question, but really close to need to refresh page in jquery mobile .
New to objective-c and I just can't find the answer to this question anywhere.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.