Skip to content

build error: ld: error: undefined symbol: locale_charset (if configure detects locale_charset) #25

Description

@jhgit
configure && make
.
.
checking for locale_charset in -liconv... yes
.
.
libtool: link: cc -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -o .libs/trietool trietool.o  -L/usr/local/lib ../datrie/.libs/libdatrie.so -Wl,-rpath -Wl,/usr/local/lib
ld: error: undefined symbol: locale_charset
>>> referenced by trietool.c
>>>               trietool.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [trietool] Error code 1

make[6]: stopped in /wrkdirs/usr/ports/devel/libdatrie/work/libdatrie-0.2.13/tools

Noticed on FreeBSD 12 with the libiconv package installed (in /usr/local).

The link command is missing -liconv

Activity

  1. jhgit commented on Nov 29, 2022

    @jhgit
    ContributorAuthor

    FYI, this started happening recently because libiconv-1.17 (released 2022) exports the locale_charset symbol whereas in libiconv-1.16 (released 2019) the symbol was NOT exported. So when building with libiconv-1.16 libdatrie's configure did not detect locale_charset.

  2. jhgit commented on Nov 30, 2022

    @jhgit
    ContributorAuthor

    Here is a patch for configure that sets ICONV_LIBS=-liconv if configure detects that it wants to use libiconv based on the presence of locale_charset (in addition to the case where configure decides it wants to use libiconv for iconv_open). This was build tested with and without libiconv.

    libdatrie.patch-configure.ac.txt

  3. added a commit that references this issue on Mar 22, 2023
    5d3e14e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions