public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nick Stokes <randomaccessiterator@gmail.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: g++ cross distro compilation problem
Date: Thu, 20 Jan 2011 19:29:00 -0000	[thread overview]
Message-ID: <AANLkTi=L+xhdtaEg1rvHsLBL3fOS6uzCSZhFeEJ3cYdc@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimLWO-axPmGeJZ1o0yTAaY8Zt7x_FzuEK6jVgct@mail.gmail.com>

On Thu, Jan 20, 2011 at 11:40 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 20 January 2011 15:53, Nick Stokes wrote:
>>
>> Assuming you are referring to compiling a code with g++  (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  /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/../../../../include/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 <ios>' | g++ -E -x c++  -
>

Great! This indeed revealed it.  In /usr/include/locale.h (same
location, line  133, in both distros actually)  there is #ifdef
__USE_GNU  on CentOS version, which is  #ifdef __USE_XOPEN2K8 in
SUSE's version.   So, in fact if I define `__USE_XOPEN2K8'  while
compiling on SUSE, it works. Hmm, go figure.. This can not be the
right way to do this. What am I missing?

Thanks!!

  reply	other threads:[~2011-01-20 19:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19  0:39 Nick Stokes
2011-01-19  0:57 ` Ian Lance Taylor
2011-01-19  1:14 ` Jonathan Wakely
2011-01-19  1:17   ` Jonathan Wakely
2011-01-19 23:27     ` Nick Stokes
2011-01-20  0:47       ` Jonathan Wakely
2011-01-20 15:53         ` Nick Stokes
2011-01-20 16:40           ` Jonathan Wakely
2011-01-20 19:29             ` Nick Stokes [this message]
2011-01-20 19:58               ` Jonathan Wakely
2011-01-20 20:01                 ` Jonathan Wakely
2011-01-21  0:57                   ` Nick Stokes
2011-01-21  2:03                     ` Nick Stokes
2011-01-21  9:16                       ` Jonathan Wakely
2011-01-21 14:35                         ` Nick Stokes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=L+xhdtaEg1rvHsLBL3fOS6uzCSZhFeEJ3cYdc@mail.gmail.com' \
    --to=randomaccessiterator@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).