Multi OS Plugin system

Started by
6 comments, last by Salec 22 years, 3 months ago
Hello, I am currently developing a plugin system. Bassically each plugin gives the program the ability to support a new file format. Currently, the plugins are dynamic link libraries. This system is working great with no problems at all. It will not run on another OS however. This is because the .dll format is windows specific. Is there any method of writing a plugin system that supports Multiple operating systems? -Salec
Advertisement
Linux has a .SO thingamajigure that is the analog of Windows'' dlls.

I''m not certain about other *nix''s. Without dll technology, plugin technology is going to be difficult.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
As Magmai said, there are also libraries for Unix. There is a visual studio wizard that will generate a skeleton project for you to build a dll on windows platforms, and provides some #define''s and a makefile so that it will also build into a unix library. I can''t find the URL right now, but someone else may have it handy.
Look for the dl library on Linux. I believe the functions of interest are dlopen(), dlsym(), and dlfree() (but I could be remembering them wrong). They work very very similar to LoadLibrary(), GetProcAddress(), and FreeLibrary() (respectively).


-Brannon
-Brannon
Mac OS9 and OSX both have shared libraries as well.

Just make sure you don''t require code in the DLLMain() of the DLL.

There is no such thing as DLLMain on the Mac.
None of my code requires any windows specific features in the plugins. I have the library for unix to create .so files and use dlOpen etc. But must I recompile my code for each OS. What I would like to have it just 1 plugin file that would work on all OS''s.

-Salec
quote:Original post by Salec
But must I recompile my code for each OS. What I would like to have it just 1 plugin file that would work on all OS''s.

you have to do this with anything you compile.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
quote:
Just make sure you don''t require code in the DLLMain() of the DLL.


Just FYI, the Win32 docs say the DLLMain() function is optional.
You don''t even need to declare it.

So, this shouldn''t be a problem if you have your own
initialization routines.

This topic is closed to new replies.

Advertisement