Re: [ooc-compiler] DLL creation with oo2c?
Brought to you by:
mva
|
From: Stewart G. <sgr...@ii...> - 2004-07-20 02:05:04
|
Hi Frank, > 2 reasons why it would be nice to generate DLLs with oo2c: > > - Using oberon in larger projects even when others use other languages > - Using oberon when the main program has to be in another language, > e.g. when it is created by a tool. Agreed. > Anything existing (working) or planned? My expert level: just managed > to compile a dll-hello-world version with mingw following some > examples on the web :-) . My understanding is that there is now some level of support for DLLs in libtool. http://www.belgeler.org/autobook/autobook-DLLs-with-Libtool.html For the Windows DLL architecture, functions that are exported or imported from DLLs have to be specially declared using: __declspec(dllimport) __declspec(dllexport) Normally, some preprocessor tricks are used so that a header file defining a module can be used for both import and export. The declaration is changed according to whether the compiled file is in the same or different DLL. It would need a little thought to determine what sort of model would work within oo2c. For Windows, we could add these tags into the compiler-generated declarations, but this would require the compiler to track which modules are grouped together in which libraries. I think it already does this, but I can't say for sure. Cheers, Stewart |