构建mongo C驱动程序

时间:2019-03-09 04:43:09

标签: mongodb mongo-cxx-driver mongo-c-driver libmongoc

我正在尝试从Kerberos支持构建C驱动程序   mongo-c-driver-1.10.3.tar.gz。我正在使用gcc的Ubuntu 16.04、64位Intel   5.4.0。我像这样运行CMake:

$ cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
    ...
    -- Build files have been written to: /home/glt/tools/new_mongo/mongo-c-driver-1.10.3/cmake-build

看起来像是cmake,但是当我执行'make'时,我失败了。

$ make
    Scanning dependencies of target bson_static
    ...
    [ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-openssl.c.o
    /home/glt/tools/new_mongo/mongo-c-driver-1.10.3/src/libmongoc/src/mongoc/mongoc-openssl.c: In function ¡®_mongoc_openssl_check_cert¡¯:
    /home/glt/tools/new_mongo/mongo-c-driver-1.10.3/src/libmongoc/src/mongoc/mongoc-openssl.c:314:16: warning: ¡®ASN1_STRING_data¡¯ is deprecated [-Wdeprecated-declarations]
                    check = (const char *) ASN1_STRING_get0_data (name->d.ia5);
                    ^
    In file included from /home/glt/miniconda3/include/openssl/e_os2.h:13:0,
                     from /home/glt/miniconda3/include/openssl/bio.h:13,
                     from /home/glt/tools/new_mongo/mongo-c-driver-1.10.3/src/libmongoc/src/mongoc/mongoc-openssl.c:23:
    /home/glt/miniconda3/include/openssl/asn1.h:554:35: note: declared here
     DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
                                       ^
    /home/glt/miniconda3/include/openssl/opensslconf.h:115:37: note: in definition of macro ¡®DECLARE_DEPRECATED¡¯
     #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                         ^
    /home/glt/miniconda3/include/openssl/asn1.h:554:1: note: in expansion of macro ¡®DEPRECATEDIN_1_1_0¡¯
     DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
     ^
    [ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cluster-sasl.c.o
    [ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-sasl.c.o
    [ 39%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cluster-cyrus.c.o
    [ 40%] Building C object src/libmongoc/CMakeFiles/mongoc_shared.dir/src/mongoc/mongoc-cyrus.c.o
    [ 40%] Linking C shared library libmongoc-1.0.so
    [ 40%] Built target mongoc_shared
    Scanning dependencies of target example-client
    [ 40%] Building C object src/libmongoc/CMakeFiles/example-client.dir/examples/example-client.c.o
    [ 40%] Linking C executable example-client
    libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_sk_num'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_gets'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_puts'
    libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_begin_catch'
    libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long)'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_set_data'
    libmongoc-1.0.so.0.0.0: undefined reference to `operator delete[](void*)'
    libmongoc-1.0.so.0.0.0: undefined reference to `operator new(unsigned long)'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_set_init'
    libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_init_ssl'
    libmongoc-1.0.so.0.0.0: undefined reference to `TLS_method'
    libmongoc-1.0.so.0.0.0: undefined reference to `std::__throw_length_error(char const*)'
    libmongoc-1.0.so.0.0.0: undefined reference to `operator delete(void*)'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_free'
    libmongoc-1.0.so.0.0.0: undefined reference to `operator new[](unsigned long)'
    libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_pure_virtual'
    libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::begin()'
    libmongoc-1.0.so.0.0.0: undefined reference to `__gxx_personality_v0'
    libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_sk_value'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_destroy'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_write'
    libmongoc-1.0.so.0.0.0: undefined reference to `std::__throw_bad_alloc()'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_read'
    libmongoc-1.0.so.0.0.0: undefined reference to `OPENSSL_init_crypto'
    libmongoc-1.0.so.0.0.0: undefined reference to `SSL_CTX_set_options'
    libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_end_catch'
    libmongoc-1.0.so.0.0.0: undefined reference to `EVP_MD_CTX_free'
    libmongoc-1.0.so.0.0.0: undefined reference to `vtable for __cxxabiv1::__class_type_info'
    libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const'
    libmongoc-1.0.so.0.0.0: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::max_size() const'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_get_data'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_new'
    libmongoc-1.0.so.0.0.0: undefined reference to `EVP_MD_CTX_new'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_create'
    libmongoc-1.0.so.0.0.0: undefined reference to `__cxa_rethrow'
    libmongoc-1.0.so.0.0.0: undefined reference to `BIO_meth_set_ctrl'
    libmongoc-1.0.so.0.0.0: undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
    collect2: error: ld returned 1 exit status
    src/libmongoc/CMakeFiles/example-client.dir/build.make:103: recipe for target 'src/libmongoc/example-client' failed
    make[2]: *** [src/libmongoc/example-client] Error 1
    CMakeFiles/Makefile2:707: recipe for target 'src/libmongoc/CMakeFiles/example-client.dir/all' failed
    make[1]: *** [src/libmongoc/CMakeFiles/example-client.dir/all] Error 2
    Makefile:149: recipe for target 'all' failed
    make: *** [all] Error 2

我将安装libmongoc,但在此过程中出现错误libmongoc-1.0.so.0.0.0: undefined reference to。  你能告诉我我需要安装什么吗?谢谢!

0 个答案:

没有答案