DLL using OF can't reach OpenGL

On Windows.

I’ve created a library that uses OF, it uses some OpenGL related classes such as ofFbo.

If I generate a static library, it just works. But if I generate a shared (dll) library, OpenGL functions crash.

I’m guessing the OpenGL context is not reachable by the dll’s, as it’s a different binary? Can someone explain why this happens?

[Deleted post content]

Turns out I needed OF to be initialized from the ofAppRunner code, as it initializes all OpenGL context properly. I was trying to directly initialize GLFW but then ofGetCurrentRenderer() and other code was not working.

More specifically, I’m running Boost testing for my DLL. I’ve defined a simple ofApp::setup in order to mix OF and Boost…here it is in case someone finds it useful:

* For unit testing using Boost test suite,
* place before any boost test case that requires OF
* to be initialized, this includes any OpenGL context
* call.
* You must call BOOST_OF_APP_END afterwards
	class ofBoostApp : public ofBaseApp{\
			void setup()\

#define BOOST_OF_APP_END \
		ofSetupOpenGL(1024,768, OF_WINDOW);\
		ofRunApp(new ofBoostApp());

Then in a test case…

    // OpenGL calls 
    // Boost test calls