JuceApplication::getInstance() from dylib returns 0?

Hey everyone,

I have been trying to figure this out all day today and can’t get to see what I’m doing wrong. I have an Xcode 4 workspace with two projects - one is the app, the other is a Bundle with a dylib that I’m loading. Both projects use Juce and statically link to it.

The application uses JUCEApplication subclass and the Bundle calls juce::initializeJuceGUI since there’s stuff that needs the GUI objects. No exceptions are thrown at initialization, no error messages etc…

The problem is, JUCEApplication::getInstance() within the bundle always returns null, even though the same call in the app has it properly initialized and returns valid pointer. Obviously that causes a ton of issues, since the dylib uses the Juce messaging system, UI classes etc…

The exact same code on Windows works just fine. Any clue on what I might be doing wrong?