[CXX-1425] "error while loading shared libraries: libmongocxx.so._noabi:" Created: 23/Aug/17  Updated: 11/Sep/19  Resolved: 28/Aug/17

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: 3.1.3
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Richard D. Johnson Assignee: Unassigned
Resolution: Done Votes: 0
Labels: driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu 16.04, gcc 5.4



 Description   

I've been working with the latest C++ version and cannot get the test to run due to the
"error while loading shared libraries: libmongocxx.so._noabi: cannot open shared object library file: No such file or directory" error

This issue was resolved by Claudio Palumbo on the issue on the Google Group at https://groups.google.com/forum/#!topic/mongodb-user/t9I2QPAkTSg
and he fixed his own error by running "apt-get upgrade" and upgrading cpp, g++ and gcc.

Since we are in the compiler business we are reluctant to upgrade those compiler elements at this time.

It looks like this may be related to the experimental C++17,
specifically C++17 features std::optional and std::string_view.

Do you know if the problem is related to this or something else, because it states at the top of the install page that the driver is compatible with gcc 4.8, 5.4. We are using 5.4.

Any additional insight will be most helpful.



 Comments   
Comment by Richard D. Johnson [ 25/Aug/17 ]

It works!

$ c++ --std=c++11 test.cpp $(pkg-config --cflags --libs libmongocxx) -Wl,-rpath,/usr/local/lib
$
$ ./a.out
{ "_id" :

{ "$oid" : "59a0a7b9fc26a222ca37a012" }

, "hello" : "world" }
$

Comment by Andrew Morrow (Inactive) [ 25/Aug/17 ]

aptech - Right, so your most recent post shows the example running. It is throwing an exception because it isn't able to connect to a running server on the local machine. So your prior issue was definitely one of getting the right library path. I suggest that you build your program with -Wl,-rpath,/usr/local/lib to work around this issue. Unfortunately, it does not seem like there is an approved way to inject the desired runtime library search path into the pkg-config file, per CXX-1071.

Comment by Richard D. Johnson [ 25/Aug/17 ]

$ ./a.out
./a.out: error while loading shared libraries: libmongocxx.so._noabi: cannot open shared object file: No such file or directory

$ LD_LIBRARY_PATH=/usr/local/lib ./a.out
terminate called after throwing an instance of 'mongocxx::v_noabi::bulk_write_exception'
what(): No suitable servers found (`serverSelectionTryOnce` set): [connection refused calling ismaster on 'localhost:27017']: generic server error

Comment by Richard D. Johnson [ 25/Aug/17 ]

$ pkg-config --cflags --libs libmongocxx
-I/usr/local/include/mongocxx/v_noabi -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/bsoncxx/v_noabi -I/usr/local/include/libbson-1.0 -L/usr/local/lib -lmongocxx -lbsoncxx

Comment by Richard D. Johnson [ 25/Aug/17 ]

here is the output for make && make install:
$ make && sudo make install
[ 2%] Built target EP_mnmlstc_core
[ 8%] Built target bsoncxx_static
[ 15%] Built target bsoncxx
[ 18%] Built target test_bson
[ 38%] Built target mongocxx_static
[ 60%] Built target mongocxx_mocked
[ 81%] Built target mongocxx
[ 98%] Built target test_driver
[100%] Built target test_instance
[ 2%] Built target EP_mnmlstc_core
[ 8%] Built target bsoncxx_static
[ 15%] Built target bsoncxx
[ 18%] Built target test_bson
[ 38%] Built target mongocxx_static
[ 60%] Built target mongocxx_mocked
[ 81%] Built target mongocxx
[ 98%] Built target test_driver
[100%] Built target test_instance
Install the project...
– Install configuration: "Release"
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/validate.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/cmake
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/enums
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/enums/type.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/enums/binary_sub_type.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test/CMakeFiles
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test/CMakeFiles/test_bson.dir
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test/CMakeFiles/test_bson.dir/__
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test/CMakeFiles/test_bson.dir/_/_
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test/CMakeFiles/test_bson.dir/_/_/third_party
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/test/CMakeFiles/test_bson.dir/_/_/third_party/catch
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/util
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/util/functor.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/json.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/string
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/postlude.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/CMakeFiles
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/compiler.hpp
– Installing: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/export.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/private
– Installing: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/config.hpp
– Installing: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/version.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/string
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/exception
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/document
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/builder
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/types
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/array
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx.dir/private
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/string
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/exception
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/document
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/builder
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/types
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/array
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/CMakeFiles/bsoncxx_static.dir/private
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/oid.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/exception
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/exception/error_code.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/exception/exception.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/document
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/core.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/document.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/kvp.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/array.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/helpers.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/basic/impl.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/single_context.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/key_context.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/closed_context.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/builder/stream/helpers.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/types
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/types/value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/stdx
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/stdx/make_unique.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/array
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/array/value.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/private
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/types.hpp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/CMakeFiles
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/CMakeFiles/EP_mnmlstc_core.dir
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/EP_mnmlstc_core-prefix
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/EP_mnmlstc_core-prefix/tmp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/EP_mnmlstc_core-prefix/src
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core-stamp
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core
– Up-to-date: /usr/local/include/bsoncxx/v_noabi/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core-build
– Installing: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/export.hpp
– Up-to-date: /usr/local/lib/libbsoncxx.so.3.1.3
– Up-to-date: /usr/local/lib/libbsoncxx.so._noabi
– Up-to-date: /usr/local/lib/libbsoncxx.so
– Up-to-date: /usr/local/lib/libbsoncxx.a
– Up-to-date: /usr/local/lib/cmake/libbsoncxx-3.1.3/libbsoncxx-config.cmake
– Up-to-date: /usr/local/lib/cmake/libbsoncxx-3.1.3/libbsoncxx-config-version.cmake
– Installing: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/config.hpp
– Installing: /usr/local/include/bsoncxx/v_noabi/bsoncxx/config/version.hpp
– Up-to-date: /usr/local/lib/pkgconfig/libbsoncxx.pc
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/cmake
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/client.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/options
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/options/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/options
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/options/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/__
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/_/_
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/_/_/third_party
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/_/_/third_party/catch
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/__/test_util
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/model
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_driver.dir/result
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_instance.dir
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_instance.dir/__
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_instance.dir/_/_
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_instance.dir/_/_/third_party
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/CMakeFiles/test_instance.dir/_/_/third_party/catch
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/model
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test/result
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/delete.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/find_one_and_replace.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/client.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/ssl.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/find_one_common_options.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/find_one_and_update.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/modify_collection.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/bulk_write.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/pool.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/create_view.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/index.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/distinct.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/count.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/insert.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/find.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/update.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/create_collection.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/options/find_one_and_delete.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/write_concern.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/config
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/config/postlude.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/config/CMakeFiles
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/config/compiler.hpp
– Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/export.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/config/prelude.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/config/private
– Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/config.hpp
– Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/version.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir/options
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir/options/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir/exception
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir/model
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx.dir/result
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir/options
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir/options/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir/exception
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir/model
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_static.dir/result
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir/options
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir/options/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir/exception
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir/model
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/CMakeFiles/mongocxx_mocked.dir/result
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/validation_criteria.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/logger.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/read_preference.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/instance.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/bulk_write.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/pool.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/cursor.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/error_code.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/query_exception.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/logic_error.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/write_exception.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/server_error_code.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/bulk_write_exception.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/exception.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/exception/authentication_exception.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/uri.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/write_type.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/insert_one.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/replace_one.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/delete_one.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/write.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/model/delete_many.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/insert_many_builder.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/database.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/collection.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/private
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/hint.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/read_concern.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/test_util
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/stdx.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/pipeline.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result/delete.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result/insert_one.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result/bulk_write.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result/replace_one.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result/update.hpp
– Up-to-date: /usr/local/include/mongocxx/v_noabi/mongocxx/result/insert_many.hpp
– Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/export.hpp
– Up-to-date: /usr/local/lib/libmongocxx.so.3.1.3
– Up-to-date: /usr/local/lib/libmongocxx.so._noabi
– Up-to-date: /usr/local/lib/libmongocxx.so
– Up-to-date: /usr/local/lib/libmongocxx.a
– Up-to-date: /usr/local/lib/cmake/libmongocxx-3.1.3/libmongocxx-config.cmake
– Up-to-date: /usr/local/lib/cmake/libmongocxx-3.1.3/libmongocxx-config-version.cmake
– Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/config.hpp
– Installing: /usr/local/include/mongocxx/v_noabi/mongocxx/config/version.hpp
– Up-to-date: /usr/local/lib/pkgconfig/libmongocxx.pc

Comment by Andrew Morrow (Inactive) [ 25/Aug/17 ]

Also of interest is CXX-1071.

Comment by Andrew Morrow (Inactive) [ 25/Aug/17 ]

aptech - Along with providing the info that matt.broadstone provided, can you please see if the following makes your program run?

LD_LIBRARY_PATH=/usr/local/lib ./a.out

If so, then this is just a runtime library search path issue.

Comment by Matt Broadstone [ 25/Aug/17 ]

aptech it looks like you're missing the output of

make && make install

after your cmake output in the last comment. Could you please provide that information, as well as the output for

pkg-config --cflags --libs libmongocxx

. Thank you!

Comment by Richard D. Johnson [ 24/Aug/17 ]

$ cmake -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local
– The CXX compiler identification is GNU 5.4.0
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– The C compiler identification is GNU 5.4.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Checking for module 'libbson-1.0>=1.5.0'
– Found libbson-1.0, version 1.7.0
– Found LIBBSON: TRUE
– Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
– Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
– Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
– Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
– Performing Test COMPILER_HAS_DEPRECATED_ATTR
– Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
– Checking for module 'libmongoc-1.0>=1.5.0'
– Found libmongoc-1.0, version 1.7.0
– Found LIBMONGOC: TRUE
– Configuring done
– Generating done
– Build files have been written to: /home/rijo/github_repos/mongo-cxx-driver
$
$ c++ --std=c++11 test.cpp $(pkg-config --cflags --libs libmongocxx)
$
$ ./a.out
./a.out: error while loading shared libraries: libmongocxx.so._noabi: cannot open shared object file: No such file or directory
$

Comment by Richard D. Johnson [ 24/Aug/17 ]
  1. https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/
  1. prerequisites Ubuntu C++11 (gcc 4.8, 5.4), CMake 3.2 or later
  1. Step 1: Install the latest version of the MongoDB C driver
  1. This did not install the latest version of libmongoc
  2. sudo apt-get install libmongoc-1.0-0
  1. libmongoc version 1.7.0

wget https://github.com/mongodb/mongo-c-driver/releases/download/1.7.0/mongo-c-driver-1.7.0.tar.gz
tar -xzf mongo-c-driver-1.7.0.tar.gz
cd mongo-c-driver-1.7.0
./configure --disable-automatic-init-and-cleanup
make
make install

  1. libbson version 1.7.0

wget https://github.com/mongodb/libbson/releases/download/1.7.0/libbson-1.7.0.tar.gz
tar -xzf libbson-1.7.0.tar.gz
cd libbson-1.7.0
./configure
make
make install

  1. Step 2: Choose a C++17 polyfill
  1. The mongocxx driver uses the experimental C++17 features std::optional and std::string_view.
  2. To compile the mongocxx driver, you must choose MNMLSTC/core (default for non-Windows platforms)
  3. Select with -DBSONCXX_POLY_USE_MNMLSTC=1. This option vendors a header-only installation of
  4. MNMLSTC/core into the bsoncxx library installation. NOTE: this will download MLNMLSTC from
  5. GitHub during the build process.
  1. Step 3: Download the latest version of the mongocxx driver.

git clone https://github.com/mongodb/mongo-cxx-driver.git --branch releases/stable --depth 1
cd mongo-cxx-driver/build/

  1. Step 4: Configure the driver

cmake -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local ..

  1. Step 5: Build and install the driver
  1. If you are using the default MNMLSTC polyfill and are installing to a directory requiring
  2. root permissions, you should install the polyfill with sudo before running make so you don’t
  3. have to run all of make with sudo:
  1. Only for MNMLSTC polyfill
    make EP_mnmlstc_core
  1. Once MNMLSTC is installed, or if you are using a different polyfill, build and install the driver:

make && sudo make install

  1. Step 6: Test your installation
  2. Copy test source program from https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation
  1. Compile with the help of pkg-config

c++ --std=c++11 test.cpp $(pkg-config --cflags --libs libmongocxx)

  1. Set PKG_CONFIG_PATH
    export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
    path=$PATH:/usr/local/lib:/usr/local/lib/pkgconfig
Comment by Andrew Morrow (Inactive) [ 24/Aug/17 ]

Could you please provide the complete CMake invocation you used, the CMake console output, the make (or ninja, etc.) command you invoked, and its console output, and then finally the complete console output generated when you try to run the test? Also, could you please let us know what version of libmongoc and libbson you are using, and how you obtained and built them?

Generated at Wed Feb 07 22:02:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.