Original Post
Greetings!
I am running into a little snag when it comes to my engine design. I wanted to create a very powerful, dynamic architecture using a plugin system in combination with DLLs.

So I have my application.exe, this executable is linked with a .lib and .dll called Engine.Core.dll. From Application.exe I call a bunch of static functions in the DLL:
The problem
...is that when I try to call a (static) function in my Engine.Core.dll from another plugin, say RandomPlugin0.dll calls:
I then get linker errors, saying there's undefined static external symbols, i.e. bool Engine::m_Running.
Where the class and (static) function Settings::Get(...) is defined inside Engine.Core.dll. I am already exporting the class Settings from Engine.Core.dll using __declspec(dllexport). Now I figured that I need to do something weird for static classes? But what? Google is not my friend.
I figured I can use the singleton idiom for my engine's Core class, but then I still need static members, static accessors, etc. to get the address of my engine's instance.
How is this usually solved? How do I create two-way communication between several DLLs? Basically I want all DLLs to call functions from each other through the Engine.Core.dll's interface for said plugins, should they need to.
Much rating awaits those who can help ;) Thanks!
[Edited by - wiegje85 on June 8, 2010 4:59:13 PM]
I am running into a little snag when it comes to my engine design. I wanted to create a very powerful, dynamic architecture using a plugin system in combination with DLLs.

So I have my application.exe, this executable is linked with a .lib and .dll called Engine.Core.dll. From Application.exe I call a bunch of static functions in the DLL:
int main(){ Engine::Create(); // create new instances of the modules in the form of plugins Engine::Run(); // run engine while its running Engine::Release(); // when we get here, we release resources return 0;}The problem
...is that when I try to call a (static) function in my Engine.Core.dll from another plugin, say RandomPlugin0.dll calls:
int val = (int)Settings::Get("varname");I then get linker errors, saying there's undefined static external symbols, i.e. bool Engine::m_Running.
Where the class and (static) function Settings::Get(...) is defined inside Engine.Core.dll. I am already exporting the class Settings from Engine.Core.dll using __declspec(dllexport). Now I figured that I need to do something weird for static classes? But what? Google is not my friend.
I figured I can use the singleton idiom for my engine's Core class, but then I still need static members, static accessors, etc. to get the address of my engine's instance.
How is this usually solved? How do I create two-way communication between several DLLs? Basically I want all DLLs to call functions from each other through the Engine.Core.dll's interface for said plugins, should they need to.
Much rating awaits those who can help ;) Thanks!
[Edited by - wiegje85 on June 8, 2010 4:59:13 PM]