Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Thrift C++ Library in Xcode
    text
    copied!<p>I want to use the Thrift 0.8.0 c++ library in Xcode. Therefore I configured thrift with </p> <pre><code>./configure --without-java --without-python --without-ruby --without-php --enable-static </code></pre> <p>I dragged the static library into my project. Then I set the "Header Search Paths" to "/usr/local/include/thrift" and "/opt/local/include" (because i installed boost with via macports). </p> <p>I can run the Thrift Server as described <a href="http://wiki.apache.org/thrift/ThriftUsageC++" rel="nofollow">here</a> </p> <p>When I try to run the client it throws several errors.</p> <p>/usr/local/include/thrift/transport/TSocket.h</p> <pre><code> sockaddr* getCachedAddress(socklen_t* len) const; </code></pre> <p>/usr/local/include/thrift/transport/TSocket.h:216:3: error: unknown type name 'sockaddr' </p> <pre><code>void setCachedAddress(const sockaddr* addr, socklen_t len); </code></pre> <p>/usr/local/include/thrift/transport/TSocket.h:216:30: error: unknown type name 'socklen_t' </p> <pre><code>void setCachedAddress(const sockaddr* addr, socklen_t len); </code></pre> <p>/usr/local/include/thrift/transport/TSocket.h:237:31: error: unknown type name 'sockaddr' </p> <pre><code> void setCachedAddress(const sockaddr* addr, socklen_t len); </code></pre> <p>/usr/local/include/thrift/transport/TSocket.h:237:47: error: unknown type name 'socklen_t' </p> <p>/usr/local/include/thrift/transport/TSocket.h:290:5: error: unknown type name 'sockaddr_in' </p> <pre><code> union { sockaddr_in ipv4; sockaddr_in6 ipv6; } cachedPeerAddr_; </code></pre> <p>/usr/local/include/thrift/transport/TSocket.h:291:5: error: unknown type name 'sockaddr_in6' </p> <pre><code>boost::shared_ptr&lt;TTransport&gt; transport(new TBufferedTransport(socket)); </code></pre> <p>.../ThriftClient/ThriftClient/Something_client.cpp .../ThriftClient/ThriftClient/Something_client.cpp:15:49:{15:68-15:74}: error: no matching constructor for initialization of 'apache::thrift::transport::TBufferedTransport' [3]</p> <p>Can anyone help me? Thank you!</p> <p><strong>UPDATE</strong></p> <p>After including in TSocket.h the following lines everything works fine.</p> <pre><code>#include &lt;sys/socket.h&gt; #include &lt;arpa/inet.h&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload