zoukankan      html  css  js  c++  java
  • mongodb c++ driver安装踩坑记

     安装教程:https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/

    (1)

    “initializer_list” file not found

    http://stackoverflow.com/questions/19493671/initializer-list-no-such-file-or-directory

    Since you are using GCC-4.8 and your problem is that you don't have the C++11 features try to add -std=c++11 to your compilation line.

    I saw that you are using CMake, then this post may help you (you can replace -std=c++0x by -std=c++11 or -std=gnu++11).

    Example:

    # It appends the -std=c++11 option to CMAKE_CXX_FLAGS
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # for gcc >= 4.7
    
    # Or
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") # for gcc < 4.7

    (2)

    安装的过程中设置环境变量CPLUS_INCLUDE_PATH 指明mongoc和bson的inlcude目录:

    http://stackoverflow.com/questions/2497344/what-is-the-environment-variable-for-gcc-g-to-look-for-h-files-during-compila

    Just look at the actual gcc documentation. It's all explained there.

    To summarize:

    • LIBRARY_PATH is for the linker, not for header files (used when looking for libraries requested by a -l option)
    • CPATH specifies directories to look for header files in (like the -I option)
    • C_INCLUDE_PATH and CPLUS_INCLUDE_PATH are like CPATH, but for C/C++ respectively

     (3)自己下载c++17的模拟库,然后放在本地,修改make file里git clone的路径

    https://github.com/mnmlstc/core/tree/v1.1.0

    (4) 

    LD_LIBRARY_PATH="/usr/local/lib"

  • 相关阅读:
    Java使用printf格式化日期
    Java时间Date类
    Java数组
    Spring Cloud Stream
    Spring Cloud Bus
    Spring Cloud Config
    api服务网关?
    SPRINGBOOT集成SWAGGER2
    MySQL锁(一)全局锁:如何做全库的逻辑备份?
    Spring的FactoryBean
  • 原文地址:https://www.cnblogs.com/bonelee/p/6555060.html
Copyright © 2011-2022 走看看