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 | [reply] [d/l] [select] |
|
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! :-( | [reply] [d/l] [select] |
|
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
| [reply] [d/l] [select] |
|
|
|
|
|
|
| [reply] [d/l] [select] |
|
|
|
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
| [reply] [d/l] |
|
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.
| [reply] |
Re: libintl.a for Strawberry Perl
by pryrt (Abbot) on Jan 24, 2019 at 14:21 UTC
|
| [reply] |
|
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 :-(
| [reply] |
|
... 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
| [reply] [d/l] |
|
|
| [reply] |