I am attmepting to declare boost ptime at the global level. However I am encountering the following issue:
Before the main function I declare:
static boost::posix_time::ptime start_time;
You define a local variable inside the
main function, one that shadows the global variable but has nothing to do with the global variable.
You should not define the variable in the
main function, only assign to it:
start_time = boost::posix_time::microsec_clock::universal_time();