I am developing a client-server application using mongoDB on Ubuntu 14.02.2 with C++ Legacy Driver. Clients do not connect to mongoDB but a server running on the device communicates with mongoDB.
I am using compiler flag "-std=c++1y -O3" in order to compile my project. However, if I use "-std=c++1y -O3", mongo::client::initialize() call causes segmentation fault.
In order to test what is going on, I created a simple main.cpp file to connect to my mongodb, query and insert objects to db, and then I verified that although it works nicely without "-std=c++1y -O3", it causes segmentation fault at initialize() call when "-std=c++1y -O3" is used.
I thought it may be due to reason that mongoDB C++ driver is not built with this flag, and tried to build mongoDB C++ driver by "-std=c++1y -O3", but I could not find out how to do that either.
Please Suggest,
Thanks and Kind Regards,
Neslisah.