I have created a header mongo.h
it contain
mongocxx::instance inst{};
mongocxx::uri uri{ "link*****" };
mongocxx::client client{ uri };
i accessed the mongodb from main.cpp
by including this
mongo.h
but when including this header to other cpp file it return error.
Documents saying that the instance must create once . i have read http://mongocxx.org/api/current/classmongocxx_1_1instance.html not understand fully, i dont familiar with constructor and destructor ,, Any body please help to access mongodb from every cpp file .