trac tickets and alternative build system
Adam Goode
agoode at andrew.cmu.edu
Wed Apr 28 11:48:26 EDT 2010
On 04/27/2010 07:05 AM, Hauke Heibel wrote:
> 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.
>
Yeah, I think DLLMain has something to do with it.
Also see:
http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc
> 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?
>
Yes, it is not really supported to work as a static library right
now because of some trickery I do to initialize gthread early on.
If you really need it as a static library, there are some things
you can do.
Adam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20100428/119651b5/attachment-0001.bin
More information about the openslide-users
mailing list