This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

1.5.24-2 (locale.h): Compilation ERRORs ?!

When I try to compile very simple example from
gettext's tutorial - I get compilation errors using
gcc or g++.

Here is the source code:
main.c or

#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>

#define _(aString) gettext(aString)

  setlocale(LC_ALL, "");
  bindtextdomain("gt", "/usr/share/locale");
  printf(_("Hello, world!\n"));

1) I CAN NOT build the test program with MinGW
$ gcc -o gt -mno-cygwin -g main.c

main.c:3:21: libintl.h: No such file or directory
In file included from
                 from main.c:5:
error: syntax error befo
re "typedef"
main.c: In function `main':
main.c:13: error: `LC_ALL' undeclared (first use in
this function)
main.c:13: error: (Each undeclared identifier is
reported only once
main.c:13: error: for each function it appears in.)

2) I CAN NOT build the test program as C-program (with

$ gcc -o gt -g main.c
In file included from /usr/include/libintl.h:22,
                 from main.c:3:
/usr/include/locale.h:26: error: syntax error before

I think it's because GCC doesn't understand
_BEGIN_STD_C, _END_STD_C macros used inside "locale.h"

3) I CAN NOT build the test program as C++-program
(with g++):

g++ -o gt -g
In file included from /usr/include/sys/config.h:167,
                 from /usr/include/_ansi.h:16,
                 from /usr/include/locale.h:10,
                 from /usr/include/libintl.h:22,
/usr/include/cygwin/config.h:18: error: expected
constructor, destructor, or typ
e conversion before "extern"
/usr/include/cygwin/config.h:18: error: expected `,'
or `;' before "extern"

What is wrong? What is the workaround?

Thank you.
Alexey Lyubimov

Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center. 

Attachment: cygcheck.out
Description: 3924260979-cygcheck.out

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]