Rubinium
Rubinium

Reputation: 121

DLL Get Symbols From Its Parent (Loader)

I am porting a program to MS Windows. This program uses dynamically loaded plugins. The plugins reference symbols in the main program. I cannot even get the DLLs past the linker without all symbols being resolved. Is there a way to solve this?

Upvotes: 3

Views: 954

Answers (1)

Nimloth
Nimloth

Reputation: 209

(Sorry, I'd like to ask for clarification in a comment but I'm too much of a newbie to be allowed.)

When you say the plugins "reference symbols in the main program", is it about referencing functions or data? Also, what language/compiler are you using?

Assuming it's only about functions, and in C/C++: it's possible to export a function from a .EXE as if it were a DLL. Just specify __declspec(dllexport) in front of the function definition in the .EXE . When compiling the .EXE, a .LIB file should get generated, which you can then use as input when linking each plugin.

Upvotes: 3

Related Questions