Skip to content

cmake build error, when using static libidn2 #14845

Description

@Nemos2024

I did this

Building curl-8.9.1 by cmake (mingw toolchain), with options
-DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DUSE_LIBIDN2=ON

It found idn2-2.3.7, but on build stage many "undefined reference"
undefined reference to u8_strlen' undefined reference to u8_to_u32'
undefined reference to `u32_to_u8'
...
As i understand from pkg_check_modules() in CMakeLists.txt only using LIBIDN2_INCLUDE_DIRS.
I examine CMakeCache file, for static lib (idn2) pkg_check_modules() give necessary LDFLAGS in LIBIDN2_STATIC_LDFLAGS.
There are flags for linking with iconv unistring and paths.

I expected the following

Build without error

curl/libcurl version

curl 8.9.1

operating system

Gentoo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions