I try to build my application with protobuf using msys2 mingw-64.
in the end of linking process I see errors like:
[ 62%] Linking CXX executable ../program.exe
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(generated_message_tctable_lite.cc.obj):(.text+0x49ef): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(generated_message_tctable_lite.cc.obj):(.text+0x4b20): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(generated_message_tctable_lite.cc.obj):(.text+0x5a78): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(generated_message_tctable_lite.cc.obj):(.text+0x5bf6): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(generated_message_tctable_lite.cc.obj):(.text+0x5dfb): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(generated_message_tctable_lite.cc.obj):(.text+0x5f76): more undefined references to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)' follow
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(text_format.cc.obj):(.text+0x5496): undefined reference to `utf8_range::SpanStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/MSYS2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/../../../../liblibprotobuf.a(wire_format_lite.cc.obj):(.text+0x2fb6): undefined reference to `utf8_range::IsStructurallyValid(std::basic_string_view<char, std::char_traits<char> >)'
collect2.exe: error: ld returned 1 exit status
If I understand it correctly, the static libprotobuf.a is found, but ld.exe is not able to find the utf8_range lib.
If I add utf8_range to target_link_libraries(), nothing changes. Same errors…
How else could I fix the error and help ld.exe find utf8_range::IsStructurallyValid ?