• Advertisement
Sign in to follow this  

Cross platform plug-in solution......

This topic is 2257 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've been wondering if I can make a pluggable application in other OS. So far it's working great in windows. I can make a DLL that exports some functions, and let my application import them for use. That sort of makes it flexible. I wonder if I can do the same thing on other OS, but AFAIK there's no DLL in linux (CMIIW), and I never used any other OS than windows and linux, so I can't say about MacOS or other OS. Do you know any better solution? Thanks before

:)

Share this post


Link to post
Share on other sites
Advertisement
In windows, they are called .dll, in Linux and FreeBSD, they're called .so. It's the same thing though. I'm guessing OSX has .so as well. I'm not entirely sure what the LoadLibrary/GetProcAddr equivalent is called, but one of them might be dl() (you can google it easy enough though)

DLL = Dynamic Link Library (or something very similar)
SO = Shared Object

If you want plugins that work without recompilation, you need scripting or a JIT language/platform such as Java or C#/.NET.

Share this post


Link to post
Share on other sites
Whoa, thanks for the reply! hmm so those .so files have similar function as .dll in windows. Hmm I don't want to use other language than C++ for now, but thanks for the suggestion. maybe I'll just have to rethink any other way to solve this problem....basically here's a bigger picture of the problem:

-I've written a simple scripting language to be used by my framework
-the scripting system can execute a C function as long as it's registered before compilation
-I put all those C function inside a dll for now, and my app will scan any dll inside the "Plugin" folder and call its interface function that basically registers those function to the scripting system
-so whenever I think I need to add more function, I'll just have to recompile the dll / build another dll and put it inside the "Plugin" folder, and they are recognized by the scripts...

I think I'll re-move those C functions back into the main app for now, at least until there's a good cross platform solution for this problem..

Share this post


Link to post
Share on other sites
Umm. If you work in C or C++, you'll have to compile your code for each platform anyway..? What I meant is that you can't take a windows dll file and place it on a linux system and expect it to work, you'll have to compile it for linux.. But you already have to do this for your application, so it might not be a problem?

Share this post


Link to post
Share on other sites
Yes of course, I have to recompile for every OS. I think I'll delete teh plugin system and instead just recompile the main app every time I need to register new function, btw thanks for the reply though :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement