Nathan Gleaves
unread,Apr 27, 2015, 4:26:55 PM4/27/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cpp-dri...@lists.datastax.com
After such a fast response to my last question. I figure i would try again with what is probably a stupid question.
I have been trying to put together a proof of concept for c++ and Cassandra for an application i work on. The POC doesn't yet do anything useful but once all of the build problems are resolved. I suspect i will be able to make some significant progress. On to the build problems:
I built the cpp-driver project and installed it using make install.
I created a very simple Hello World project. All it does is include <cassandra.h> and then print out "hello, world"
If i remove the Cassandra linking from my CMake file, everything works, (as one might expect). But once i add in to linking to the Cassandra library, i cant get anything other than.
Scanning dependencies of target counts
[100%] Building CXX object CMakeFiles/counts.dir/main.cpp.o
Linking CXX executable counts
ld: library not found for -lcassandra
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [counts] Error 1
make[2]: *** [CMakeFiles/counts.dir/all] Error 2
make[1]: *** [CMakeFiles/counts.dir/rule] Error 2
make: *** [counts] Error 2
Here is my CMakeLists.txt file.
cmake_minimum_required(VERSION 3.1)
project(counts)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(counts ${SOURCE_FILES})
include_directories(/usr/local/include)
LINK_DIRECTORIES(/usr/local/lib64)
TARGET_LINK_LIBRARIES(counts cassandra)
main.cpp:
#include <iostream>
#include <cassandra.h>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
I assume this is my fault. I am not very used to doing things in c++. It has been a node.js world for a while. I have found a couple of things mentioning RPATH for OSX but none of it has helped yet.
Any help would be greatly appreciated.