1

trying to install the Text::Unaccent module

I have next error, Can someone help ?

C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
   Unaccent.o:Unaccent.c:(.text+0x96):
      undefined reference to `unac_debug_callback'
collect2.exe: error: ld returned 1 exit status
gmake: *** [Makefile:480: blib\arch\auto\Text\Unaccent\Unaccent.xs.dll] Error 1
  LDACHARY/Text-Unaccent-1.08.tar.gz
  C:\STRAWB~1\c\bin\gmake.exe -- NOT OK
Stopping: 'install' failed for 'Text::Unaccent'.

[Wrapped long lone for readability]

4
  • "undefined reference to unac_debug_callback": I think this was reported 4 years ago here: rt.cpan.org/Public/Bug/Display.html?id=124815 Commented Dec 19, 2022 at 12:45
  • The workaround provided in the bug report didn't works. I open a ticket. Commented Dec 19, 2022 at 15:53
  • Ok, I will check it later. Commented Dec 19, 2022 at 16:03
  • 1
    The workaround worked for me on Windows 11, see answer below Commented Dec 19, 2022 at 20:02

1 Answer 1

4

undefined reference to unac_debug_callback

This issue has been reported earlier here: https://rt.cpan.org/Public/Bug/Display.html?id=124815

As commented by SREZIC in that thread: Adding

 #define HAS_VPRINTF

to unac.c seems to workaround the problem. I tested this on Windows 11, Strawberry perl version 5.32.1 and this works fine:

  • Downloaded the tar ball here: https://cpan.metacpan.org/authors/id/L/LD/LDACHARY/Text-Unaccent-1.08.tar.gz

  • Unpacked and extracted the tar ball

  • Cd into the unpacked directory, and edit unac.c. Like the following patch shows:

    diff --git a/unac.c b/unac.c
    index 20863d2..2c63fc2 100644
    --- a/unac.c
    +++ b/unac.c
    @@ -20,6 +20,7 @@
     #include "config.h"
     #endif /* HAVE_CONFIG_H */
    
    +#define HAS_VPRINTF
     /*
      * Perl config.h defines HAS_VPRINTF if printf variants are
      * available
    
  • Run perl Makefile.PL; gmake; gmake test; gmake install:

:

>perl Makefile.PL
Checking if your kit is complete...
Looks good

Generating a gmake-style Makefile
Writing Makefile for Text::Unaccent
Writing MYMETA.yml and MYMETA.json

>gmake
cp Unaccent.pm blib\lib\Text\Unaccent.pm
Running Mkbootstrap for Unaccent ()
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 "Unaccent.bs"
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Unaccent.bs blib\arch\auto\Text\Unaccent\Unaccent.bs 644
"C:\Strawberry\perl\bin\perl.exe" "C:\Strawberry\perl\lib\ExtUtils/xsubpp"  -typemap C:\STRAWB~1\perl\lib\ExtUtils\typemap  Unaccent.xs > Unaccent.xsc
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e mv -- Unaccent.xsc Unaccent.c
gcc -c  -I. -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"1.08\" -DXS_VERSION=\"1.08\"  "-IC:\STRAWB~1\perl\lib\CORE"  -DHAVE_CONFIG_H Unaccent.c
Unaccent.xs: In function 'XS_Text__Unaccent_unac_string':
Unaccent.xs:71:20: warning: passing argument 5 of 'unac_string' from incompatible pointer type [-Wincompatible-pointer-types]
           &buffer, &buffer_length) == 0) {
                    ^~~~~~~~~~~~~~
In file included from Unaccent.xs:35:
unac.h:96:23: note: expected 'size_t *' {aka 'long long unsigned int *'} but argument is of type 'int *'
   char** out, size_t* out_length);
               ~~~~~~~~^~~~~~~~~~
Unaccent.xs: In function 'XS_Text__Unaccent_unac_string_utf16':
Unaccent.xs:88:19: warning: passing argument 4 of 'unac_string_utf16' from incompatible pointer type [-Wincompatible-pointer-types]
          &buffer, &buffer_length) == 0) {
                   ^~~~~~~~~~~~~~
In file included from Unaccent.xs:35:
unac.h:79:23: note: expected 'size_t *' {aka 'long long unsigned int *'} but argument is of type 'int *'
   char** out, size_t* out_length);
               ~~~~~~~~^~~~~~~~~~
Unaccent.xs: In function 'XS_Text__Unaccent_unac_debug':
Unaccent.xs:109:10: warning: implicit declaration of function 'unac_debug_callback'; did you mean 'unac_debug_print'? [-Wimplicit-function-declaration]
          unac_debug_callback(in, unac_debug_print, NULL);
          ^~~~~~~~~~~~~~~~~~~
          unac_debug_print
gcc -c  -I. -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -s -O2   -DVERSION=\"1.08\" -DXS_VERSION=\"1.08\"  "-IC:\STRAWB~1\perl\lib\CORE"  -DHAVE_CONFIG_H unac.c
unac.c: In function 'unac_string':
unac.c:13889:59: warning: passing argument 6 of 'convert' from incompatible pointer type [-Wincompatible-pointer-types]
     if(convert(charset, utf16be(), in, in_length, &utf16, &utf16_length) < 0) {
                                                           ^~~~~~~~~~~~~
unac.c:13774:27: note: expected 'size_t *' {aka 'long long unsigned int *'} but argument is of type 'int *'
      char** outp, size_t* out_lengthp)
                   ~~~~~~~~^~~~~~~~~~~
unac.c:13893:63: warning: passing argument 4 of 'unac_string_utf16' from incompatible pointer type [-Wincompatible-pointer-types]
     unac_string_utf16(utf16, utf16_length, &utf16_unaccented, &utf16_unaccented_length);
                                                               ^~~~~~~~~~~~~~~~~~~~~~~~
unac.c:13674:30: note: expected 'size_t *' {aka 'long long unsigned int *'} but argument is of type 'int *'
         char** outp, size_t* out_lengthp)
                      ~~~~~~~~^~~~~~~~~~~
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \
     -e "Mksymlists('NAME'=>\"Text::Unaccent\", 'DLBASE' => 'Unaccent', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"
g++ Unaccent.def -o blib\arch\auto\Text\Unaccent\Unaccent.xs.dll -mdll -s -L"C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" Unaccent.o unac.o   "C:\STRAWB~1\perl\lib\CORE\libperl532.a" "C:\STRAWB~1\c\lib\libiconv.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 755 blib\arch\auto\Text\Unaccent\Unaccent.xs.dll

>gmake test
"C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Unaccent.bs blib\arch\auto\Text\Unaccent\Unaccent.bs 644
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/unac.t .. ok
All tests successful.
Files=1, Tests=4,  0 wallclock secs ( 0.00 usr +  0.00 sys =  0.00 CPU)
Result: PASS

> gmake install
[...]
Files found in blib\arch: installing files in blib\lib into architecture dependent library tree
Installing C:\STRAWB~1\perl\site\lib\auto\Text\Unaccent\Unaccent.xs.dll
Installing C:\STRAWB~1\perl\site\lib\Text\Unaccent.pm
Appending installation info to C:\STRAWB~1\perl\lib/perllocal.pod
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.