[CXX-2137] Compilation failure with older GCC and Boost (on RHEL 7) Created: 01/Dec/20  Updated: 21/Aug/23  Resolved: 21/Aug/23

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

Type: Bug Priority: Major - P3
Reporter: Roberto Sanchez Assignee: Roberto Sanchez
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CXX-2634

 Description   

A user in the Community Forum reported an issue with building the C++ driver. I confirmed the failure.

Configuration: RHEL 7, GCC 4.8.5, Boost 1.58 (installed from upstream sources, as RHEL7 ships with Boost 1.53).

Error output:

[  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_shared.dir/document/element.cpp.o
cd /root/mongo-cxx-driver-r3.6.2/build/src/bsoncxx && /usr/bin/c++  -DBSONCXX_EXPORT -DMONGO_CXX_DRIVER_COMPILING -I/root/mongo-cxx-driver-r3.6.2/src -I/root/mongo-cxx-driver-r3.6.2/build/src -I/usr/local/include -isystem /usr/local/include/libbson-1.0  -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -std=c++11 -o CMakeFiles/bsoncxx_shared.dir/document/element.cpp.o -c /root/mongo-cxx-driver-r3.6.2/src/bsoncxx/document/element.cpp
In file included from /root/mongo-cxx-driver-r3.6.2/src/bsoncxx/json.hpp:21:0,
                 from /root/mongo-cxx-driver-r3.6.2/src/bsoncxx/document/element.cpp:22:
/root/mongo-cxx-driver-r3.6.2/src/bsoncxx/stdx/optional.hpp:52:38: error: too many initializers for 'const nullopt_t {aka const boost::none_t}'
 const nullopt_t nullopt{::boost::none};
                                      ^
make[2]: *** [src/bsoncxx/CMakeFiles/bsoncxx_shared.dir/document/element.cpp.o] Error 1
make[2]: Leaving directory `/root/mongo-cxx-driver-r3.6.2/build'
make[1]: *** [src/bsoncxx/CMakeFiles/bsoncxx_shared.dir/all] Error 2
make[1]: Leaving directory `/root/mongo-cxx-driver-r3.6.2/build'
make: *** [all] Error 2



 Comments   
Comment by Roberto Sanchez [ 21/Aug/23 ]

In discussing this with rishabh.bisht@mongodb.com, it is outside the scope of what we can reasonably maintain to include builds for RHEL7 (i.e., older g++ with not-so-robust c++11 support) with non-standard Boost. As a result, we have decided to close this ticket as "won't fix."

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