$ g++ -lthrift -Wall thriftfs.cpp cassandra_constants.cpp Cassandra.cpp cassandra_types.cpp -o thriftfs -I/usr/local/include/thrift -L/usr/local/lib In file included from /usr/local/include/thrift/protocol/TProtocol.h:23:0, from /usr/local/include/thrift/TProcessor.h:24, from Cassandra.h:10, from t`enter code here`hriftfs.cpp:4: /usr/local/include/thrift/transport/TTransport.h:34:1: error: ‘uint32_t’ does not name a type /usr/local/include/thrift/transport/TTransport.h:156:29: error: ISO C++ forbids declaration of ‘buf’ with no type [-fpermissive] In file included from /usr/local/include/thrift/TProcessor.h:24:0, from Cassandra.h:10, from thriftfs.cpp:4: /usr/local/include/thrift/protocol/TProtocol.h:184:1: error: ‘uint32_t’ does not name a type In file included from Cassandra.h:10:0, from thriftfs.cpp:4: /usr/local/include/thrift/TProcessor.h:72:57: error: ‘uint32_t’ has not been declared In file included from cassandra_types.h:11:0, from Cassandra.h:11, from thriftfs.cpp:4: /usr/local/include/thrift/TApplicationException.h:94:3: error: ‘uint32_t’ does not name a type In file included from Cassandra.h:11:0, from thriftfs.cpp:4: cassandra_types.h:85:16: error: ‘uint8_t’ does not name a type In file included from Cassandra.h:11:0, from thriftfs.cpp:4: cassandra_types.h:142:3: error: ‘uint32_t’ does not name a type In file included from Cassandra.h:11:0, from thriftfs.cpp:4: cassandra_types.h:1478:16: error: ‘uint8_t’ does not name a type In file included from Cassandra.h:11:0, from thriftfs.cpp:4: cassandra_types.h:1812:3: error: ‘uint32_t’ does not name a type In file included from thriftfs.cpp:4:0: Cassandra.h:217:3: error: ‘uint32_t’ does not name a type Cassandra.h:4857:35: error: ‘org::apache::thrift’ has not been declared Cassandra.h:4857:62: error: expected ‘,’ or ‘...’ before ‘*’ token Cassandra.h:4859:71: error: cannot declare pointer to ‘void’ member Cassandra.h:4859:145: error: template argument 2 is invalid Cassandra.h:4859:145: error: template argument 4 is invalid Cassandra.h:4860:45: error: ‘org::apache::thrift’ has not been declared Cassandra.h:4860:72: error: expected ‘,’ or ‘...’ before ‘*’ token Cassandra.h:4935:42: error: ‘thrift’ is not a member of ‘org::apache’ Cassandra.h:4935:42: note: suggested alternative: /usr/local/include/thrift/Thrift.h:75:37: note: ‘apache::thrift’ Cassandra.h:4935:42: error: ‘thrift’ is not a member of ‘org::apache’ Cassandra.h:4935:42: note: suggested alternative: /usr/local/include/thrift/Thrift.h:75:37: note: ‘apache::thrift’ Cassandra.h:4935:77: error: template argument 1 is invalid Cassandra.h:4935:105: error: ‘thrift’ is not a member of ‘org::apache’ Cassandra.h:4935:105: note: suggested alternative: /usr/local/include/thrift/Thrift.h:75:37: note: ‘apache::thrift’ Cassandra.h:4935:105: error: ‘thrift’ is not a member of ‘org::apache’ Cassandra.h:4935:105: note: suggested alternative: /usr/local/include/thrift/Thrift.h:75:37: note: ‘apache::thrift’ Cassandra.h:4935:140: error: template argument 1 is invalid Cassandra.h: In constructor ‘org::apache::cassandra::CassandraProcessor::CassandraProcessor(boost::shared_ptr)’: Cassandra.h:4898:49: error: assignment of read-only location ‘"login"[((org::apache::cassandra::CassandraProcessor*)this)->org::apache::cassandra::CassandraProcessor::processMap_]’ Cassandra.h:4898:49: error: cannot convert ‘void (org::apache::cassandra::CassandraProcessor::*)(int32_t, int) {aka void (org::apach
答案 0 :(得分:2)
添加以下定义:
g++ -DHAVE_NETINET_IN_H -DHAVE_INTTYPES_H ...
或者在您的代码中添加#include <stdint.h>
之前添加Thrift.h
。
请参阅THRIFT-1326上的讨论。这个问题在节俭0.9中得到了修正。
答案 1 :(得分:0)
看起来您的问题是编译器问题。
找不到类型“uint32_t”
关于此,还有另外一个问题:
'uint32_t' identifier not found error
引自用户 templatetypedef
此类型在C头中定义,当前不是 C ++标准的一部分。根据Wikipedia页面上的 标题,它直到VS2010才附带Visual Studio。
与此同时,你可能会假装你自己的版本 通过添加将Microsoft的自定义整数类型映射到的typedef来添加标头 C期望的类型。例如:
typedef __int32 int32_t; typedef unsigned __int32 uint32_t; / * ...... 等... * /希望这有帮助!