From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21010 invoked by alias); 20 Jan 2011 16:40:13 -0000 Received: (qmail 20973 invoked by uid 22791); 20 Jan 2011 16:40:10 -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-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Jan 2011 16:40:05 +0000 Received: by iyj18 with SMTP id 18so753286iyj.20 for ; Thu, 20 Jan 2011 08:40:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.218.5 with SMTP id ho5mr2841352icb.403.1295541603176; Thu, 20 Jan 2011 08:40:03 -0800 (PST) Received: by 10.42.230.66 with HTTP; Thu, 20 Jan 2011 08:40:03 -0800 (PST) In-Reply-To: References: Date: Thu, 20 Jan 2011 16:40: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/msg00309.txt.bz2 On 20 January 2011 15:53, Nick Stokes wrote: > > Assuming you are referring to compiling a code with g++ =A0(and not Yep, that's what I meant. > compiling gcc itself), then no it doesn't make a difference. (in fact, > g++ -v shows that _GNU_SOURCE is already defined). > > Could it be some other silly mistake on my part, e.g forgetting to set > an environment variable or something? Indeed there is the distro's g++ > compiler installed on the login node, and most of these headers -- > that are potentially incompatible with the gcc versions I am trying to > install under /opt -- are under common places =A0/usr/include etc. You don't need to set any environment variables to use GCC, the 4.4.3 compiler under /opt will find its own c++ headers not the ones in /usr/include/c++/x.y.z (you can check the paths printed with -v to see that for yourself) You need to find why uselocale is not defined here: /opt/gcc/4.4.3/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.3/../../../../in= clude/c++/4.4.3/x86_64-unknown-linux-gnu/bits/c++locale.h:52: error: 'uselocale' was not declared in this scope Try using the -E flag and examining the preprocessed output. Do that on both machines and look for differences in the path or contents of the locale.h header. To minimise the output it should be sufficient to do: echo '#include ' | g++ -E -x c++ -