跟踪错误的原因是什么?我们在编译Thrift C ++代码时遇到此错误

时间:2012-10-16 14:35:24

标签: c++ cassandra thrift

  thriftfs-test$ g++ -lthrift -Wall thriftfs.cpp cassandra_constants.cpp Cassandra.cpp cassandra_types.cpp -o thriftfs
    In file included from thriftfs.cpp:7:0:
    Cassandra.h:10:24: fatal error: TProcessor.h: No such file or directory
    compilation terminated.
    In file included from cassandra_constants.h:10:0,
                     from cassandra_constants.cpp:7:
    cassandra_types.h:10:20: fatal error: Thrift.h: No such file or directory
    compilation terminated.
    In file included from Cassandra.cpp:7:0:
    Cassandra.h:10:24: fatal error: TProcessor.h: No such file or directory
    compilation terminated.
    In file included from cassandra_types.cpp:7:0:
    cassandra_types.h:10:20: fatal error: Thrift.h: No such file or directory
    compilation terminated. 

2 个答案:

答案 0 :(得分:3)

您必须包含include目录的路径,例如:

g++ -lthrift -I /path/to/thriftfs/include -Wall thriftfs.cpp cassandra_constants.cpp Cassandra.cpp cassandra_types.cpp -o thriftfs

答案 1 :(得分:-1)

您忘了在g ++命令行中添加一些必需的include-folder /。