bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems using gettext on Windows


From: Bruno Haible
Subject: Re: Problems using gettext on Windows
Date: Thu, 10 Mar 2011 00:20:19 +0100
User-agent: KMail/1.9.9

Hi,

Joerg Henrichs wrote:
> #include <stdio.h>
> #include <libintl.h>
> //#undef fprintf
> 
> int main(int argc, char* argv[])
> {
>      fprintf(stderr, "Hello world stderr\n");
>      fprintf(stdout, "Hello world stdout\n");
>          return 0;
> }
> 
> I only copied libintl.h, and intl.lib, and iconv.dll and intl.dll from
> the gettext/libiconv packages, nothing else (for a normal console 
> application). Compiled as 'release' (i.e. /MD - multithreaded DLL) - and 
> it immediately crashes in the first fprintf statement.

Ouch. I cannot believe that the code of libintl_fprintf is so broken.
But I don't remember to which C library the binaries you got - from
January 2004, 7 years old - link against. Also I don't know to which
C library your programs link against, when - as you say - you compile
with /MD.

The right thing to so would be to rebuild libiconv and gettext from source
with your compiler; then you would have the guarantee that it combines
well with the other parts of your project. But that takes time; especially
if you don't have Cygwin installed.

For my part, I've learned the lesson from these complexities: Newer versions
of my packages are tested with mingw only. There's only one binary format of
mingw .o and .dll files, no risk of mixing stuff that's meant to be linked
against different C library versions. I'm sorry if this disappoints you,
but I think it's a waste of time for GNU maintainers to struggle with a
platform where every new version of the C compilers brings 2 or 3 new
versions of the C library.

On Linux, Solaris, and MacOS X you also have two binary formats (32-bit and
64-bit), but there at least the linker produces an error when you try to
link stuff together that doesn't fit together.

Bruno
-- 
In memoriam Otto Freundlich <http://en.wikipedia.org/wiki/Otto_Freundlich>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]