基本思想如下: 没有用于MATLAB的Cassandra驱动程序,但有C++ Driver。在VS12中创建项目,我可以查询数据库没有问题。在MATLAB MEX函数中链接Cassandra/C++驱动程序库
我在MATLAB中创建了一个MEX文件来调用网关C++函数从数据库中获取数据。使用MATLAB MEX: 1 - 编译mex文件和网关功能正常工作,没有问题。 2 - 包含文件和Cassandra.lib文件的路径是正确的。
不过,在联动阶段,卡珊德拉类不能找到:
mex ('-v',ipath_cassandra_code,ipath_cassandra, cSourceFile,'accessCassandra.cpp','-lcassandra','-lcassandra_static')
getFromCassandra.cpp:网关功能卡桑德拉 accessCassandra.cpp:MATLAB MEX文件调用getFromCassandraRes()在网关getFromCassandra。 CPP文件
的错误,我得到:
Creating library getFromCassandra.lib and object getFromCassandra.exp
getFromCassandra.obj : error LNK2019: unresolved external symbol cass_cluster_new referenced in function "class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getFromCassandraRes(char *,char *,int,int,class
std::vector<struct muStatsStruct,class std::allocator<struct muStatsStruct> > &)"
我使用的是C++卡桑德拉驱动程序二进制文件为我的64位窗口。 MATLAB版本:8.5.0.197613(R2015a) 卡桑德拉/ C++驱动程序:从http://datastax.github.io/cpp-driver/
你的帮助,最新的是赞赏。