I am trying to compile a C++ example program (TestConnection.Cpp) attached for connection to Cassandra. I get the following compilation error:
**g++ -Wall TestConnection.cpp cassandra_constants.cpp Cassandra.cpp cassandra_types.cpp -I /home/srai/Cassandra/apache-cassandra-2.1.8/cpp-driver/include/ -lthrift
In file included from /usr/local/include/thrift/thrift-config.h:23:0,
from /usr/local/include/thrift/Thrift.h:25,
from cassandra_types.h:12,
from cassandra_constants.h:10,
from cassandra_constants.cpp:7:
cassandra_constants.h:18:15: error: expected unqualified-id before string constant
std::string VERSION;
^
cassandra_constants.cpp: In constructor ‘org::apache::cassandra::cassandraConstants::cassandraConstants()’:
cassandra_constants.cpp:14:11: error: assignment of read-only location ‘"0.9.2"’
VERSION = "19.39.0";
^
cassandra_constants.cpp:14:11: error: incompatible types in assignment of ‘const char [8]’ to ‘const char [6]’**
I have tried a possible solution at this post without success.
http://mail-archives.apache.org/mod_mbox/incubator-thrift-user/201008.mbox/%3C4C77F49...@facebook.com%3E
Can someone please guide me? Thanks