public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Oscar Fuentes <ofv@wanadoo.es>
To: gcc-help@gcc.gnu.org
Subject: Re: More template(s) errors with GCC3.2-7
Date: Wed, 23 Apr 2003 00:20:00 -0000	[thread overview]
Message-ID: <n0iijc6n.fsf@wanadoo.es> (raw)
In-Reply-To: <1051051041.1191.10.camel@Vaio>

Rade Trimceski <rtrimces@mtu.edu> writes:

> Can someone demystify this error for me?
>
> It comes out of a header file, and this did compile with gcc 2.96.
>
> typedef hash_map<int, Neighbor_Entry *> Neighbors_Hash;
>
> the compilation error is:
>
> In file included from diffusion3/apps/gear/geo-routing.cc:11:
> diffusion3/apps/gear/geo-routing.hh:187: syntax error before `;' token
>
>
> Any ideas why I get the syntax error, and what it really means?

Well, the error message is not a great help on this case. What really
happens is that 'hash_map' is an unknown template for the compiler.

GCC 3.x comes with a new Standard C++ Library implementation, which is
far more conformant than the previous one. All standard C++ library
names are on namespace 'std'.

For this specific case, 'hash_map' is not a standard C++ library
template. However, the GNU implementors added it for supporting old
code (and as a nice extension, I guess). It's on namespace __gnu_cxx,
implemented on <ext/hash_map>.

I think this issues are explained on some README on the GCC
distribution or on the website. The 'std' namespace thing is something
every C++ developer should know since a long time ago, though.

-- 
Oscar

  reply	other threads:[~2003-04-23  0:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 16:34 template(s) declaration " Rade Trimceski
2003-04-22 16:48 ` John Love-Jensen
2003-04-22 22:37   ` More template(s) errors " Rade Trimceski
2003-04-23  0:20     ` Oscar Fuentes [this message]
2003-04-23 18:58   ` please unsubscribe claudio

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=n0iijc6n.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=gcc-help@gcc.gnu.org \
    /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).