Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

libintl.a for Strawberry Perl

by fdesar (Beadle)
on Jan 24, 2019 at 09:03 UTC ( [id://1228901]=perlquestion: print w/replies, xml ) Need Help??

fdesar has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks,

I'm desperately seeking a libintl.a for Strawberry Perl...

Could someone help me, please.

Thank you in advance for your Wisdom

Replies are listed 'Best First'.
Re: libintl.a for Strawberry Perl
by syphilis (Archbishop) on Jan 24, 2019 at 13:15 UTC
    I'm desperately seeking a libintl.a for Strawberry Perl...

    If you have MSYS2, then pacman will be able to install libintl - and that library will then be accessible to Strawberry Perl.
    It's a bit of a process getting MSYS2 installed, and I'm not the best candidate for providing guidance - but there is the wiki.
    BTW, if Strawberry's perl -V:archname output matches 'x64' then you want the "64 bit" MSYS2. Otherwise you want the 32 bit version.

    Other than that, if you provide me with the output of perl -V:archname I might be able to help out.

    For which perl module are you wanting libintl ?

    Cheers,
    Rob

      Great: I finally found it as you said in in MSYS2: libintl.a (and libintl.h too)

      But that doesn't seem sufficient: when I compile and link a simple program calling gettext(), I get a linking error :

      Program:

      #include "libintl.h" int main() { gettext("abc"); }

      Compiling:

      C:\Users\Moi\strawberry-perl-5.28.1.1-64bit-portable\Moi\test>gcc -o t +est test.c C:\Users\Moi\AppData\Local\Temp\ccCWWHXa.o:test.c:(.text+0x15): undefi +ned reference to `libintl_gettext' collect2.exe: error: ld returned 1 exit status

      I'm puzzled for now...

      BTW, the module I want to get working is Locale::gettext which does exactly what I need under Linux and macOS.

      I tried the Gido's pure Perl version of Locale::gettext_pp but his code doen't understand the windows pseudo-locale so it doesn't work.

      PS: before, I hated Windows but I think now I abhor it! :-(

        Your problem is the supplied library from Developer Files is in 32-bit format and your using 64-bit Strawberry Perl; and thus, 64-bit gcc. Your test program above compiles fine for me with Strawberry 5.18 32-bit:

        gcc .\test.c -I.\include -L.\lib -lintl -o test.exe

        Try a 32-bit Perl (and thus 32-bit gcc) or try the following.

        Using your existing 64-bit Strawberry (and thus 64-bit gcc), from a cmd.exe prompt in the directory where you unzip both the Developer files (from above) link and the Binaries

        pexports .\bin\libintl3.dll > intl.def dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libintl.a --inp +ut-def intl.def gcc .\test.c -I .\include -L . -lintl -o test.exe

        The above worked for me - creating my own 64-bit libintl.a from the provided libintl3.dll and then compiling test.exe linking that created libintl.a

        Try gcc -o test test.c -lintl assuming libintl.* is in the libraries search path, alternatively tell gcc where to find it using -L blahblahlocation

Re: libintl.a for Strawberry Perl
by bliako (Monsignor) on Jan 24, 2019 at 09:14 UTC

    Don't thank me, thank groogle and the GNU people: http://gnuwin32.sourceforge.net/packages/libintl.htm

      There is not a libintl.a alearady compiled in their run time packages, only a linintl.lib which seems not compatible with Strawberry Perl environment.

      And last be not least, recompiling from the sources is quite difficult as the config script needed to generate the Makefile.in is missing : I've tried for hours to get something working from it with no success.

      That's why I ask for help.

Re: libintl.a for Strawberry Perl
by pryrt (Abbot) on Jan 24, 2019 at 14:21 UTC
      I tested Locale::gettext_pp on Windows and it doesn't work, as it (roughly) assumes the system POSIX::setlocale(LC_MESSAGES,"") will return the locale to use, which is not the case for Windows :-(
        ... it doesn't work, as it (roughly) assumes the system POSIX::setlocale(LC_MESSAGES,"") will return the locale to use, which is not the case for Windows

        The documentation for Locale::gettext indicates that it, too, relies on POSIX::setlocale(LC_MESSAGES,""). (See the SYNOPSIS.)

        Cheers,
        Rob

        That's unfortunate. I'm surprised they don't have a check for that in their test suite. You might want to file a bug report.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1228901]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found