On a MSVC system, with libunistring 1.0 installed, a Gnulib testdir has link errors:
libgnu.a(categ_and_not.obj) : error LNK2019: unresolved external symbol __UC_CATEGORY_NONE referenced in function _uc_general_category_and_not libgnu.a(categ_and.obj) : error LNK2019: unresolved external symbol __UC_CATEGORY_NONE referenced in function _uc_general_category_and libgnu.a(categ_byname.obj) : error LNK2019: unresolved external symbol __UC_CATEGORY_NONE referenced in function _uc_general_category_byname libgnu.a(categ_of.obj) : error LNK2019: unresolved external symbol __UC_CATEGORY_NONE referenced in function _uc_general_category The cause is that the gl_LIBUNISTRING_MODULE has determined that since libunistring >= 0.9.8 is present, the file lib/unictype/categ_none.c does not need to be compiled. But the symbol _UC_CATEGORY_NONE is not exported from libunistring. (This is intentional, since it's not a public API.) This patch fixes the link errors. 2023-04-23 Bruno Haible <br...@clisp.org> category-none: Fix link errors on MSVC, when libunistring is installed. * modules/unictype/category-none (configure.ac): Remove gl_LIBUNISTRING_MODULE invocation. (Makefile.am): Compile unictype/categ_none.c always. diff --git a/modules/unictype/category-none b/modules/unictype/category-none index c07d55a96f..7b8aa83da6 100644 --- a/modules/unictype/category-none +++ b/modules/unictype/category-none @@ -8,12 +8,11 @@ Depends-on: unictype/base configure.ac: -gl_LIBUNISTRING_MODULE([0.9.8], [unictype/category-none]) +dnl Since _UC_CATEGORY_NONE is not exported from an installed libunistring, +dnl don't use gl_LIBUNISTRING_MODULE here. Makefile.am: -if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_NONE lib_SOURCES += unictype/categ_none.c -endif Include: "unictype.h"