在Cygwin上编译MongoDB c++驱动程序
Compiling MongoDB C++ driver on Cygwin
我试图用'scons'命令在Cygwin上编译MongoDB c++驱动程序,我得到以下错误:
src/mongo/db/nonce.cpp:48:20: error: ‘srandomdev’ was not declared in this scope
那是什么lib ?
谢谢。
srandomdev函数在BSD或OSX系统的stdlib.h中可用,而在GNU系统如Cygwin或Linux上不可用。
看起来构建脚本无法识别您在Cygwin上运行的事实。有几个选择你可以尝试一下。最简单的是
修改ifdef子句
如果没有Windows机器来测试,很难确认这是否适用于您。在src/mongo/platform/random.cpp中,编辑第108行
#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__)
#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__) || defined(__CYGWIN__)
删除最后一个else子句
找到src/mongo/platform/random.cpp看起来像
的那行(在我的版本中是141)#else
class SRandSecureRandom : public SecureRandom {
public:
删除#endif
子句下面的行,然后编辑
#elif defined(__linux__) || defined(__sunos__) || defined(__APPLE__)
就是
#else
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 使用mongocxx驱动程序时包含头文件问题
- void*到驱动程序中的UnicodeString
- C++驱动程序看不到头文件
- 用于创建/注册虚拟存储设备的 IOKit 驱动程序
- 员工测试驱动程序数据结构
- 获取 OID(类型::b_oid)作为 MongoDB C++驱动程序中的字符串
- 如何在 c++ 中映射驱动程序?
- 如何在 cuda 中将 kd 树从主机复制到驱动程序
- Visual Studio 如何在内核模式驱动程序项目中使用C++标准库?
- 为什么我的驱动程序只读取部分字符串?
- 为 Sql 服务器实现 odbc 包装器.将数据库数据读取为字符或要求驱动程序将数据转换为 C 类型
- 如何在C++中将OID_PM_WOL_PATTERN_LIST发送到NDIS驱动程序?
- C++ 创建 NdisProt 驱动程序的句柄
- 使用 mongo c++ 驱动程序查询嵌套的 BSON 文档
- 有没有办法使用 mongocxx 驱动程序从 GridFS 集合的文件下载任意范围?
- 使用CMake ExternalProject_Add构建mongo cxx驱动程序
- SQL Server-未找到数据源名称,也未指定默认驱动程序
- 钩子SSDT.其他驱动程序使用我的函数