[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-libunistring] Problem with static libunistring
From: |
Bruno Haible |
Subject: |
Re: [bug-libunistring] Problem with static libunistring |
Date: |
Mon, 08 Oct 2018 00:31:52 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-137-generic; KDE/5.18.0; x86_64; ; ) |
Hi,
> I'm using libunistring with mingw-w64
> <https://aur.archlinux.org/packages/mingw-w64-gcc/> on arch linux
> through the aur
> <https://aur.archlinux.org/packages/mingw-w64-libunistring/>, but since
> the package uses https://ftp.gnu.org/gnu/libunistring/, I don't think my
> problem is related to the way it's packaged.
>
> I have a *C* project using *libcurl*, wich depends on *libunistring*,
> and want to compile it *statically* with *mingw* (using
> "libunistring.a"), but get the following errors, related to uninorm.h if
> I'm correct :
>
> * |undefined reference to '__imp_uninorm_nfc'|
>
> * |undefined reference to '__imp_uninorm_nfc'|
>
> * |undefined reference to '__imp_UC_CATEGORY_M'|
>
> * |undefined reference to '__imp_uninorm_nfc'|
>
> |These errors don't occur when I use the *dynamic* version of
> libunistring (using "libunistring.dll.a").
> I have no idea where this problem comes from, so I assumed this was a bug.
> |
>
> |Do you have any idea ?
The issue is with variables defined by the libunistring library.
The LIBUNISTRING_DLL_VARIABLE macro, defined in
<includedir>/unistring/woe32dll.h
must be
* set to __declspec (dllimport) when you are using the dynamic
version (libunistring.dll.a),
* set to empty when you are using the statis version (libunistring.a).
The files installed by libunistring cannot know how you will want to
use it; they assume that if you built the dynamic version or both, you
will use the dynamic version.
Bruno