Mongocxx accessing Error from different cpp file

Hi,
my scenario :
created a header file mongo.h - it contain instance creation ,uri, cliemt creation

.......header files....
mongocxx::instance inst{};
mongocxx::uri uri{******};
mongocxx::client client{ uri };

and in a.cpp file iam included mongo.h
and accessed successfully, insert success - everything success under this a.cpp
But the issue is it can b accessed from other cpp file .
because the mongo.h file contain code that should run once so.
how to resolve this problem , i need to access mongodb from every cpp file …
please help ,