[cairo] [MSVC] Link Error when building Static Libraries using Meson
Naveen M K
naveen at syrusdark.website
Thu Feb 25 14:02:55 UTC 2021
Hi,
Thanks for the reply. I made one issue
https://gitlab.freedesktop.org/cairo/cairo/-/issues/461
Regards,
Naveen
24.02.2021, 22:13, "Tim-Philipp Müller" <t.i.m at zen.co.uk>:
> On Tue, 2021-02-23 at 15:30 +0530, Naveen M K wrote:
>
> Hi Naveen,
>
>> I tried building Cairo statically on MSVC 2019. I got some link
>> errors.
>>
>> (snip)
>> csi-replay.c.obj : error LNK2019: unresolved external symbol
>> __imp_cairo_create
>> (snip)
>
> I haven't tested static meson builds on Windows with MSVC, so I'm just
> guessing here but I suspect it's related to the cairo_public __declspec
> import/export defines.
>
> I believe these linker errors with __imp_* happen when the app gets
> built with symbols imported via __declspec(dllimport), i.e. in
> expectation of an import lib for the dynamic library, but you're not
> actually doing dynamic linking then.
>
> It might just work if you configure meson with
>
> -DCAIRO_WIN32_STATIC_BUILD
>
> as additional CFLAGS/c_args, and you will need to set this when you
> build your own app later too then.
>
> We might be able to handle this case better automatically in Cairo's
> meson build, so would be great if you could file an issue in gitlab
> about it at
>
> https://gitlab.freedesktop.org/cairo/cairo
>
> Thanks!
>
> Cheers
> Tim
>
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo
More information about the cairo
mailing list