[CXX-1510] Unable to Compile - 'bson_decimal128_t' was not declared in this scope Created: 04/Feb/18  Updated: 27/Oct/23  Resolved: 04/Feb/18

Status: Closed
Project: C++ Driver
Component/s: BSON
Affects Version/s: 3.1.0
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Brandon Boudreaux Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 16.04 32-bit


Attachments: File CMakeOutput.log    

 Description   

I am unable to build. See below:

$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local .. -DBSONCXX_POLY_USE_MNMLSTC=1 -DLIBMONGOC_DIR=/usr -DLIBBSON_DIR=/usr
-- 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
-- Found LIBBSON: bson-1.0  
-- 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
-- Found LIBMONGOC: mongoc-1.0  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bit/mongo-cxx-driver/build

Scanning dependencies of target EP_mnmlstc_core
[  0%] Creating directories for 'EP_mnmlstc_core'
[  1%] Performing download step (git clone) for 'EP_mnmlstc_core'
-- EP_mnmlstc_core download command succeeded.  See also /home/bit/mongo-cxx-driver/build/src/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core-stamp/EP_mnmlstc_core-download-*.log
[  1%] No patch step for 'EP_mnmlstc_core'
[  1%] No update step for 'EP_mnmlstc_core'
[  2%] Performing configure step for 'EP_mnmlstc_core'
-- EP_mnmlstc_core configure command succeeded.  See also /home/bit/mongo-cxx-driver/build/src/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core-stamp/EP_mnmlstc_core-configure-*.log
[  2%] Performing build step for 'EP_mnmlstc_core'
-- EP_mnmlstc_core build command succeeded.  See also /home/bit/mongo-cxx-driver/build/src/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core-stamp/EP_mnmlstc_core-build-*.log
[  2%] Performing install step for 'EP_mnmlstc_core'
-- EP_mnmlstc_core install command succeeded.  See also /home/bit/mongo-cxx-driver/build/src/bsoncxx/third_party/EP_mnmlstc_core-prefix/src/EP_mnmlstc_core-stamp/EP_mnmlstc_core-install-*.log
[  2%] Performing fix-includes step for 'EP_mnmlstc_core'
[  2%] Completed 'EP_mnmlstc_core'
[  2%] Built target EP_mnmlstc_core
Scanning dependencies of target bsoncxx_static
[  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/element.cpp.o
[  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/value.cpp.o
[  3%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/view.cpp.o
[  3%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/builder/core.cpp.o
/home/bit/mongo-cxx-driver/src/bsoncxx/builder/core.cpp: In member function 'void bsoncxx::v_noabi::builder::core::append(const bsoncxx::v_noabi::types::b_decimal128&)':
/home/bit/mongo-cxx-driver/src/bsoncxx/builder/core.cpp:348:5: error: 'bson_decimal128_t' was not declared in this scope
     bson_decimal128_t d128;
     ^
/home/bit/mongo-cxx-driver/src/bsoncxx/builder/core.cpp:349:5: error: 'd128' was not declared in this scope
     d128.high = value.value.high();
     ^
/home/bit/mongo-cxx-driver/src/bsoncxx/builder/core.cpp:352:74: error: 'bson_append_decimal128' was not declared in this scope
     bson_append_decimal128(_impl->back(), key.data(), key.length(), &d128);
                                                                          ^
src/bsoncxx/CMakeFiles/bsoncxx_static.dir/build.make:134: recipe for target 'src/bsoncxx/CMakeFiles/bsoncxx_static.dir/builder/core.cpp.o' failed
make[2]: *** [src/bsoncxx/CMakeFiles/bsoncxx_static.dir/builder/core.cpp.o] Error 1
CMakeFiles/Makefile2:437: recipe for target 'src/bsoncxx/CMakeFiles/bsoncxx_static.dir/all' failed
make[1]: *** [src/bsoncxx/CMakeFiles/bsoncxx_static.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2



 Comments   
Comment by Andrew Morrow (Inactive) [ 04/Feb/18 ]

Great, happy you got it working.

Comment by Brandon Boudreaux [ 04/Feb/18 ]

Hey Andrew. I actually got it to work by compiling and installing my own version of libmongoc.

You can close this! Thanks!

Comment by Andrew Morrow (Inactive) [ 04/Feb/18 ]

What version of the C driver do you have installed in /usr?

Comment by Brandon Boudreaux [ 04/Feb/18 ]

When changing the -DLIBBSON_DIR to /usr/lib/i386-linux-gnu I get bson.h: No Such file or directory

[  2%] Built target EP_mnmlstc_core
Scanning dependencies of target bsoncxx_static
[  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/element.cpp.o
[  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/value.cpp.o
[  3%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/view.cpp.o
/home/bit/mongo-cxx-driver/src/bsoncxx/array/view.cpp:21:18: fatal error: bson.h: No such file or directory
compilation terminated.
src/bsoncxx/CMakeFiles/bsoncxx_static.dir/build.make:110: recipe for target 'src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/view.cpp.o' failed
make[2]: *** [src/bsoncxx/CMakeFiles/bsoncxx_static.dir/array/view.cpp.o] Error 1
CMakeFiles/Makefile2:437: recipe for target 'src/bsoncxx/CMakeFiles/bsoncxx_static.dir/all' failed
make[1]: *** [src/bsoncxx/CMakeFiles/bsoncxx_static.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

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