You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Antonio Martinez <an...@gmail.com> on 2012/01/07 09:06:39 UTC
Problem Compiling in C++ with Thrift
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 <https://gist.github.com/1573845>
Full Error <https://gist.github.com/1573848>
The full text of my example program can be found along with this question
here <http://stackoverflow.com/q/8765473/516927>
Thanks again!
--
Antonio Perez de Tejada Martinez