I have a .dll header which declares a class.
After the class declaration it instantiates a static object of the class.
The functions the .dll exports interface with the static object.
I'm getting an inexplicable segfault when the first call into one of these exported functions returns. So my question is: Is it OK to declare a static object in a .dll header like this:
class Foo{
public:
void bar();
};
static Foo foo;
__declspec( dllexport ) void func() { foo.bar(); }