From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24225 invoked by alias); 23 Apr 2003 00:20:25 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 24215 invoked from network); 23 Apr 2003 00:20:24 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by sources.redhat.com with SMTP; 23 Apr 2003 00:20:24 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1987yx-00069v-00 for ; Wed, 23 Apr 2003 02:19:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-help@gcc.gnu.org Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1987yw-00069k-00 for ; Wed, 23 Apr 2003 02:19:26 +0200 From: Oscar Fuentes Subject: Re: More template(s) errors with GCC3.2-7 Date: Wed, 23 Apr 2003 00:20:00 -0000 Message-ID: References: <1051051041.1191.10.camel@Vaio> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.1 Cancel-Lock: sha1:vjmERmPPl0dOAkry3gkmtYWUL2M= X-SW-Source: 2003-04/txt/msg00206.txt.bz2 Rade Trimceski 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 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 . 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