cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Martinez <>
Subject Problem Compiling in C++ with Thrift
Date Sat, 07 Jan 2012 08:06:39 GMT
Hi, I was trying to compile a simple example for connecting to a cassandra
instance using the thrift interface. As a note, I am doing all of this
without access to super user privileges on a linux machine.

I installed thrift and the c++ generator, put the include headers on my
CPLUS_INCLUDE_PATH variable, and the lib directory on my LIBRARY_PATH, and
LD_LIBRARY_PATH. Cassandra is also installed and I ran thrift --gen cpp
cassandra.thrift to generate the cassandra header files.

Using those I compiled my example like so
g++ -Wall run_measure.cpp cassandra_constants.cpp Cassandra.cpp
cassandra_types.cpp -lthrift -o cassandra_example

The top of the errors that I get are

In file included from run_measure.cpp:13:Cassandra.h:4289: error:
‘org::apache::thrift’ has not been declaredCassandra.h:4289: error:
expected ‘,’ or ‘...’ before ‘*’ tokenCassandra.h:4291: error: cannot
declare pointer to ‘void’ memberCassandra.h:4291: error: template
argument 2 is invalid

Its complaining mostly about things in the generated files so I am not sure
if I can change them or if I did something else wrong. As reference my
thrift install is to $HOME/thrift so the path of the include is a little
wierd, it looks like $HOME/thrift/include/thrift but I don't think that
would cause this error. If anyone has any experience using cassandra in c++
I would really appreciate the help.

Full Cassandra.cpp <>
Full Error <>

The full text of my example program can be found along with this question
here <>

Thanks again!
Antonio Perez de Tejada Martinez

View raw message