I have a static var that calls to a constructor in a library in C++, something like this:
class ClassToBuild {
public:
ClassToBuild() {
// Some cool stuff happens here...
}
};
static ClassToBuild classToBuild;
The problem is that when this file is included in C++, the constructor is being called before the main function, but when I include this libraries from Go, the constructor is not being called. This are third part libraries that I can't modify, and the ClassToBuild is not exposed in the header, so I can't call it from outside.
How can I do to execute the constructor?
Thanks!