Cassandra C++ Example code not compiling : cassandra_constants.cpp: error: assignment of read-only location

50 views
Skip to first unread message

Suleman Rai

unread,
Jul 13, 2015, 7:13:27 AM7/13/15
to cpp-dri...@lists.datastax.com

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


TestConnection.cpp

Lussier, Denis

unread,
Jul 15, 2015, 1:28:26 AM7/15/15
to cpp-driver-user
what platform and compiler are you trying?

To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-us...@lists.datastax.com.

Suleman Rai

unread,
Jul 15, 2015, 1:40:49 AM7/15/15
to cpp-dri...@lists.datastax.com
I am on ubuntu 14.04 LTS and using gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
Reply all
Reply to author
Forward
0 new messages