编译Thrift c ++库时出错

时间:2014-07-09 13:28:59

标签: c++ sockets thrift

我正在为Airavata C ++ API编写客户端示例,其中包括thrift c ++库。由于包含了thrift库,我在编译时遇到了很多错误。我使用以下命令进行编译:

gcc -I / home / ixxi-2013 / Desktop / airavata-cpp-sdk / lib / -Wall -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H $(INC)pkg-config --cflags glib-2.0 createProject.cpp pkg-config --libs glib-2.0

我设法找出了一些问题,但我目前陷入了以下错误。有关如何解决这些问题的任何建议都会有所帮助。

/home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:187:25: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:187:41: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:187:59: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:243:24: error: aggregate ‘apache::thrift::transport::TSocket::openConnection(apache::thrift::transport::addrinfo*)::sockaddr_un address’ has incomplete type and cannot be defined
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:263:31: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:263:62: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:278:29: error: elements of array ‘apache::thrift::transport::TSocket::openConnection(apache::thrift::transport::addrinfo*)::pollfd fds [1]’ have incomplete type
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:278:29: error: storage size of ‘fds’ isn’t known
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:281:19: error: ‘POLLOUT’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:282:41: error: ‘poll’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:318:25: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:318:62: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘void apache::thrift::transport::TSocket::local_open()’:
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:355:19: error: aggregate ‘apache::thrift::transport::addrinfo hints’ has incomplete type and cannot be defined
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:363:20: error: ‘AI_PASSIVE’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:363:33: error: ‘AI_ADDRCONFIG’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:366:57: error: ‘getaddrinfo’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:369:106: error: ‘gai_strerror’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:377:34: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:382:14: error: invalid use of incomplete type ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.h:245:30: error: forward declaration of ‘struct apache::thrift::transport::addrinfo’
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:386:26: error: ‘freeaddrinfo’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:393:20: error: ‘freeaddrinfo’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘virtual uint32_t apache::thrift::transport::TSocket::read(uint8_t*, uint32_t)’:
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:434:37: error: ‘gettimeofday’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:454:37: error: ‘gettimeofday’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘std::string apache::thrift::transport::TSocket::getPeerHost()’:
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:717:21: error: ‘NI_MAXHOST’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:718:24: error: ‘NI_MAXSERV’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:721:17: error: ‘clienthost’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:722:17: error: ‘clientservice’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:722:56: error: ‘getnameinfo’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp: In member function ‘std::string apache::thrift::transport::TSocket::getPeerAddress()’:
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:751:21: error: ‘NI_MAXHOST’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:752:24: error: ‘NI_MAXSERV’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:755:17: error: ‘clienthost’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:756:17: error: ‘clientservice’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:757:17: error: ‘NI_NUMERICHOST’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:757:32: error: ‘NI_NUMERICSERV’ was not declared in this scope
    /home/ixxi-2013/Desktop/airavata-cpp-sdk/lib/thrift/transport/TSocket.cpp:757:46: error: ‘getnameinfo’ was not declared in this scope

1 个答案:

答案 0 :(得分:0)

正如have found out in the meantime ;-),请点击steps outlined in the documentation

cd thrift
./bootstrap.sh
./configure
make
make install