From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24105 invoked by alias); 20 Jan 2011 19:58:06 -0000 Received: (qmail 24087 invoked by uid 22791); 20 Jan 2011 19:58:05 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 19:57:57 +0000 Received: by ywi6 with SMTP id 6so317290ywi.20 for ; Thu, 20 Jan 2011 11:57:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.220.69 with SMTP id hx5mr3144622icb.336.1295553475036; Thu, 20 Jan 2011 11:57:55 -0800 (PST) Received: by 10.42.230.66 with HTTP; Thu, 20 Jan 2011 11:57:54 -0800 (PST) In-Reply-To: References: Date: Thu, 20 Jan 2011 19:58:00 -0000 Message-ID: Subject: Re: g++ cross distro compilation problem From: Jonathan Wakely To: Nick Stokes Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00315.txt.bz2 On 20 January 2011 19:28, Nick Stokes wrote: > > Great! This indeed revealed it. =A0In /usr/include/locale.h (same > location, line =A0133, in both distros actually) =A0there is #ifdef > __USE_GNU =A0on CentOS version, which is =A0#ifdef __USE_XOPEN2K8 in > SUSE's version. =A0 So, in fact if I define `__USE_XOPEN2K8' =A0while > compiling on SUSE, it works. Hmm, go figure.. This can not be the > right way to do this. What am I missing? I don't know why they're different (on my glibc 2.12 system the uselocale definition is guarded by __USE_GNU, just like your CentOS system) but it looks like you've found the solution. Users are not supposed to use the __USE_XXX macros, instead you should define _GNU_SOURCE to enable __USE_GNU and _POSIX_C_SOURCE=3D200809L (or greater) to enable __USE_XOPEN2K8.