[cairo] Re: Linking to Cairo 1.0.2 statically (Win32)

Vladimir Vukicevic vladimirv at gmail.com
Thu Oct 13 17:39:07 PDT 2005


There are no C++ static constructors in cairo; there is win32 mutex
initialization that needs to happen once per application, however. 
It's being done in DllMain now, which isn't used in the case of a
static build.

    - Vlad

On 10/13/05, Bill Spitzak <spitzak at d2.com> wrote:
> I'm confused as to what the problem is. We are statically linking with
> c++ Windows .lib files and having no trouble with the c++ static
> constructors being called without any special code in our main program.
> Either I am completely misunderstanding the problem here, or cairo could
> put any necessary static constructors into the same place in the library
> that the c++ compiler put the static constructor code.
>
> Vladimir Vukicevic wrote:
>
> >
> > It's actually irrelevant for us; we use cairo from a single thread
> > only, so we currently just use the noop stubs for the mutex functions.
> >
> > A reasonable suggestion would be a cairo_win32_init() method --
> > DllMain would call this, and it would be protected by a static int
> > somewhere to avoid double initialization.  So if you're using a DLL,
> > you'd notice no change and need to do nothing extra.  If you wanted to
> > link statically, you would call cairo_win32_init() yourself.  In
> > practice, an app that might want to link either dynamically or
> > statically would call cairo_win32_init() at all times, so it's an open
> > question whether calling it automatically from DllMain() would be a
> > help or just cause confusion.
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
>


More information about the cairo mailing list