0
votes

Really basic issue. I'm trying to install the Datastax Cassandra C++ driver on my Ubuntu 16.0.4 machine. It really shouldn't be that difficult. I've installed all dependencies using dpkg and installed the cassandra driver deb file. But I can't find (or #include) the cassandra.h file. Running

$ locate cassandra.h

returns nothing and running

$ locate cassandra*

returns a whole mess of files from cqlsh, the casssandra config files, etc, but no header files for the cpp driver. Additionally, cassandra-cpp-driver doesn't show up in dpkg -l (though apt-get and dpkg -i say it's already installed).

Any help getting this installed would be appreciated.

1

1 Answers

4
votes

DataStax C/C++ Driver for Apache Cassandra is currently not available from the Ubuntu official repository.

There are .deb packages for Ubuntu which are available as mentioned in the DataStax project documentation on github datastax/cpp-driver repository from this location:

http://downloads.datastax.com/cpp-driver/

If you are using Ubuntu 16.04, the last .deb available are under ubuntu/16.04/cassandra/v2.7.0/.

You will find the cassandra.h file in cassandra-cpp-driver-dev_2.7.0-1_amd64.deb, which you need to download and install with dpkg.

The suffix dev in a Debian or Ubuntu package denotes a package meant for developing programs, containing, in particular, header files.

dpkg -i cassandra-cpp-driver-dev_2.7.0-1_amd64.deb

The header will get installed in the usual location under Linux for header files that your compiler should find without a problem: /usr/include/cassandra.h.

it will also install:

/usr/lib/x86_64-linux-gnu/libcassandra_static.a
/usr/lib/x86_64-linux-gnu/pkgconfig/cassandra.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/cassandra_static.pc
/usr/share/doc/cassandra-cpp-driver-dev/changelog.Debian.gz
/usr/share/doc/cassandra-cpp-driver-dev/copyright

which you will need for static linking and for pkgconfig to work properly.

What you may have installed is cassandra-cpp-driver_2.7.0-1_amd64.deb which contains the libcassandra.so.2.7.0 that is the shared object (dynamic) library binary file,.. although whatever you installed should indeed come in the result of a dkpg -l query such as:

dpkg -l | grep cassandra

If you installed anything from an unofficial source, I would suggest you uninstall these first, and install the provided .deb for your plaform from the official source.

Follow the documentation's instructions for making your first program with this library.