Can't you declare your variable (IPhysicsSystem* _g_PhysicsSystemInstance) globally? Isn't that what you really want:
dllmain.cpp
extern IPhysicsSystem* _g_PhysicsSystemInstance;
From what I know, extern allows you to declare a variable inside the global scope of a source-file, and use it (when properly initialized on another file) by another file.
What happens when you declare it inside the scope of a function?
Sorry if I am the one making questions here =D
Programming is an art. Game programming is a masterpiece!
Whelp, moving the extern like you said fixes the issue!
But that's a bit odd since I use externs inside function scope all over the place with no issue (yet!).
It has something to do with the fact that I'm using "extern "C" __declspec (dllexport)" to declare the function because if I remove it it also works fine.
How is a function declared for export from a dll different from a normal function?