Skip to content
Advertisement

Tag: static

Duplicate static variable initialization in C++

I build a shared library “libMyLibrary.so” with a class “MyClass” that contains a static variable of type “MyClass”. Then I build an executable “MyLibraryTest” that I link against “libMyLibrary.so”. The main program uses “dlopen” to load dynamically a “.so” given as an argument. While building, the library and executable are generated in a directory, say, “buildDir/bin”. Then I install the

Advertisement