trac tickets and alternative build system

Hauke Heibel hauke.heibel at googlemail.com
Tue Apr 27 07:05:00 EDT 2010


On Mon, Apr 26, 2010 at 10:02 PM, Adam Goode <agoode at andrew.cmu.edu> wrote:
>> 5) void __attribute ((constructor)) _openslide_init(void);
>>
>> The constructor attribute is not supported under MSCV. I temporarily
>> hacked around it by declaring the function as void
>> _openslide_init(void);
>
> Yeah, for VS, there must be some way to annotate functions to be run as
> DLL constructors. This can be abstracted in openslide-features.h like
> OPENSLIDE_PUBLIC is.

VS is offering this functionality through a function called DLLMain.
It is called when the DLL is loaded as well as when it's unloaded and
thus it can be used to take care of initialization as well as cleanup.
I did not yet use it since so far all my DLLs are just collections of
functions or classes without the need for cleanup and initialization.

See here for details: http://tinyurl.com/3xuupkk

This is also somehow implying that the library it not intended to be
build as a static library, right?

Regards,
Hauke



More information about the openslide-users mailing list