通过xcode编译我的代码在OSX中使用mongodb c驱动程序
compiling my code to use mongodb c driver in OSX via xcode
我试图在OSX(10.9.5)上做一个C应用程序,它将连接到mongodb并执行CRUD操作。我正在使用从https://github.com/mongodb/mongo-c-driver/releases/tag/1.3.5下载的1.3.5版本我成功地在我的系统上安装了mongo。我正在制作我的应用程序,它将使用库来执行CRUD操作。我使用Xcode 6.1.1作为我的IDEon osx。我已经为ide中的头文件提供了适当的路径,并且在运行之前没有警告或错误。我已经给出了动态库的搜索路径,所以我认为链接也应该发生得很好。但是,当我尝试运行时,我得到以下错误:
架构的未定义符号x86_64:
"_bson_as_json",引用自:
_main in find.o "_bson_destroy", referenced from: _main in find.o "_bson_free", referenced from: _main in find.o "_bson_new", referenced from: _main in find.o "_mongoc_cleanup", referenced from: _main in find.o "_mongoc_client_destroy", referenced from: _main in find.o "_mongoc_client_get_collection", referenced from: _main in find.o "_mongoc_client_new", referenced from: _main in find.o "_mongoc_collection_destroy", referenced from: _main in find.o "_mongoc_collection_find", referenced from: _main in find.o "_mongoc_cursor_destroy", referenced from: _main in find.o "_mongoc_cursor_next", referenced from: _main in find.o "_mongoc_init", referenced from: _main in find.o ld: symbol(s) not found for architecture x86_64 clang:error: linker command failed with exit code 1 (use -v to see invocation)
我哪里错了?
看起来您已经为libmongoc-1.0指定了动态库路径。但不是它所依赖的库libson -1.0. So。这两个库都是在您构建驱动程序时安装的,因此您应该能够指定一个额外的路径,并且您的程序将正确链接。
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- 获取 OID(类型::b_oid)作为 MongoDB C++驱动程序中的字符串
- MongoDB C++ 驱动程序 - 8 位和 16 位整数?
- 将 MongoDB C++ 驱动程序升级到 mongocxx-3.1.2
- Mongodb C驱动程序在Windows上安装失败
- 在 mongodb c++ 驱动程序中使用声明"not found"
- 在Windows上构建MongoDB C 驱动程序
- MongoDB C驱动程序:如何使用Regex查询集合
- Mongodb c ++驱动程序问题
- 带有MongoDB C 驱动程序的BSON文档中的鳍
- 交叉编译用于ARM的MongoDB C++驱动程序.找不到Boost库
- 在Ubuntu中包括MongoDB C 驱动程序的错误
- 如何在ubuntu中安装适用于c++的mongodb驱动程序
- MongoDB C++ 驱动程序 -- 通过引用传递查询对象在随后使用其排序时会引发错误
- MongoDB C++驱动程序服务器端查询计数
- 如何在c++mongodb驱动程序中使用$set、$inc等
- MongoDB 3.2 c++驱动程序,使用$exists
- MongoDB C++ 驱动程序 - 错误:尚未声明"mongo::client"
- mongoDb c++驱动程序忽略mongoclient库
- 如何为 Ubuntu 安装 MongoDB C++ 驱动程序