From: Johan S. <jo...@if...> - 2005-09-16 18:15:33
|
Hi. I have now discovered how we must rig shallows to actually generate a prope= r=20 DLL out of it. With this setup scons creates both a shallows.dll and=20 shallows.lib file. See http://www.flounder.com/ultimateheaderfile.htm for a bit of background. Basically, every class and function declaration needs the following=20 prepended to its declaration when we are building shallows: class __declspec( dllexport ) Texture { ... }=20 When we are using shallows, they need the following declaration: class __declspec( dllimport ) Texture { ... } The trick is of course some macro magic in config.h: #ifdef COMPILING_SHALLOWS #define DllExport __declspec( dllexport ) #else #define DllExport __declspec( dllimport ) #endif And then add DllExport in front of every class and function declaration. class DllExport Texture { ... } I have a working copy of shallows with this enabled, but since it is a=20 rather large change, I would like to hear your opinions on this. (On Linux we of course always make the DllExport macro to be whitespace.) Is this okay for all of you? --=20 Help a man with his math problems and you get him off your back for a day. Teach a man math, and you scare him off for the rest of your life. Regards Johan Seland PhD Student Center of Mathematics for Applications University of Oslo |
From: Jon H. <jon...@gm...> - 2005-09-19 09:08:23
|
Hi since the dllExport thing must be written in front of every function, it pollutes the code rather much. So the question is do we really need to make dll files at all or can we just create a static library? Personally I would prefer to avoid the pollution more than having dlls, what do you think? On 9/16/05, Johan Seland <jo...@if...> wrote: > Hi. > =20 > I have now discovered how we must rig shallows to actually generate a > proper DLL out of it. With this setup scons creates both a shallows.dll a= nd > shallows.lib file. > =20 > See http://www.flounder.com/ultimateheaderfile.htm for a > bit of background. > =20 > Basically, every class and function declaration needs the following > prepended to its declaration when we are building shallows: > =20 > class __declspec( dllexport ) Texture { ... }=20 > =20 > When we are using shallows, they need the following declaration: > =20 > class __declspec( dllimport ) Texture { ... } > =20 > The trick is of course some macro magic in config.h: > =20 > #ifdef COMPILING_SHALLOWS > #define DllExport __declspec( dllexport ) > #else > #define DllExport __declspec( dllimport ) > #endif > =20 > And then add DllExport in front of every class and function declaration. > =20 > class DllExport Texture { ... } > =20 > I have a working copy of shallows with this enabled, but since it is a > rather large change, I would like to hear your opinions on this. > (On Linux we of course always make the DllExport macro to be whitespace.= ) > =20 > Is this okay for all of you? > =20 > --=20 > Help a man with his math problems and you get him off your back for a day= . > Teach a man math, and you scare him off for the rest of your life. >=20 > Regards Johan Seland > PhD Student > Center of Mathematics for Applications=20 > University of Oslo |
From: Johan S. <jo...@if...> - 2005-09-19 09:25:43
|
As you might have seen, I have checked in a rather bit patch with this code= =20 pollution.=20 I do think it is nice for shallows to be a proper DLL, and I do think not= =20 the code pollution is that much of a problem.=20 I think it also is possible to avoid the code pollution by have a separate= =20 header (possibly automatically generated?) defining the __declspec(=20 DllExport ) thingy. I will look into this this evening. On 9/19/05, Jon Hjelmervik <jon...@gm...> wrote: >=20 > Hi >=20 > since the dllExport thing must be written in front of every function, > it pollutes the code rather much. So the question is do we really need > to make dll files at all or can we just create a static library? > Personally I would prefer to avoid the pollution more than having > dlls, what do you think? >=20 > On 9/16/05, Johan Seland <jo...@if...> wrote: > > Hi. > > > > I have now discovered how we must rig shallows to actually generate a > > proper DLL out of it. With this setup scons creates both a shallows.dll= and > > shallows.lib file. > > > > See http://www.flounder.com/ultimateheaderfile.htm for a > > bit of background. > > > > Basically, every class and function declaration needs the following > > prepended to its declaration when we are building shallows: > > > > class __declspec( dllexport ) Texture { ... } > > > > When we are using shallows, they need the following declaration: > > > > class __declspec( dllimport ) Texture { ... } > > > > The trick is of course some macro magic in config.h: > > > > #ifdef COMPILING_SHALLOWS > > #define DllExport __declspec( dllexport ) > > #else > > #define DllExport __declspec( dllimport ) > > #endif > > > > And then add DllExport in front of every class and function declaration= . > > > > class DllExport Texture { ... } > > > > I have a working copy of shallows with this enabled, but since it is a > > rather large change, I would like to hear your opinions on this. > > (On Linux we of course always make the DllExport macro to be=20 > whitespace.) > > > > Is this okay for all of you? > > > > -- > > Help a man with his math problems and you get him off your back for a= =20 > day. > > Teach a man math, and you scare him off for the rest of your life. > > > > Regards Johan Seland > > PhD Student > > Center of Mathematics for Applications > > University of Oslo >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server.=20 > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Shallows-devel mailing list > Sha...@li... > https://lists.sourceforge.net/lists/listinfo/shallows-devel >=20 --=20 Help a man with his math problems and you get him off your back for a day. Teach a man math, and you scare him off for the rest of your life. Regards Johan Seland PhD Student Center of Mathematics for Applications University of Oslo |