public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "James Tebneff" <tebneff@gmail.com>
To: "David Arthur" <darthur@tantacomm.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: STL problems in GCC 4.1.2
Date: Tue, 12 Feb 2008 23:20:00 -0000	[thread overview]
Message-ID: <359fcc390802121520j8b7102n8d7ac94f9dd919bb@mail.gmail.com> (raw)
In-Reply-To: <000401c86dc8$ff7391f0$500010ac@gx520>

On Feb 13, 2008 9:15 AM, David Arthur <darthur@tantacomm.com> wrote:
> Well, here goes. I'll snip a chunk out of the middle to shorten the post!
>
> c++ -I/home/dart/src/dartnms/include -I/home/dart/src/plugappsdk/include -I/home/dart/src/dartnms/plugins/dartnmsbase/include -I/home/dart/src/lib -D_LINUX_ -Wno-deprecated -c -fpermissive -o /home/dart/src/dartnms/obj/main.o /home/dart/src/dartnms/src/main.cpp
> /usr/include/c++/4.1.2/bits/stl_tree.h:330: error: expected identifier before ‘}’ token
> /usr/include/c++/4.1.2/bits/stl_tree.h:330: error: expected unqualified-id before ‘}’ token
> /usr/include/c++/4.1.2/bits/stl_tree.h:330: error: expected unqualified-id before ‘else’
> /usr/include/c++/4.1.2/bits/stl_tree.h:791: error: no ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::operator=(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)’ member function declared in class ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>’
> /usr/include/c++/4.1.2/bits/stl_tree.h:791: error: template definition of non-template ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::operator=(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)’
> /usr/include/c++/4.1.2/bits/stl_tree.h: In member function ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::operator=(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)’:
> /usr/include/c++/4.1.2/bits/stl_tree.h:797: error: ‘_M_impl’ was not declared in this scope
> /usr/include/c++/4.1.2/bits/stl_tree.h: At global scope:
> /usr/include/c++/4.1.2/bits/stl_tree.h:813: error: ‘typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert’ is not a static member of ‘class std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>’
> /usr/include/c++/4.1.2/bits/stl_tree.h:813: error: template definition of non-template ‘typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert’
>
> [...snip...]
>
> /usr/include/c++/4.1.2/bits/stl_tree.h:1485: error: ‘__x’ was not declared in this scope
> /usr/include/c++/4.1.2/bits/stl_map.h: At global scope:
> /usr/include/c++/4.1.2/bits/stl_map.h:127: error: expected identifier before ‘}’ token
> /usr/include/c++/4.1.2/bits/stl_map.h:127: error: expected unqualified-id before ‘}’ token
> /usr/include/c++/4.1.2/bits/stl_map.h:127: error: expected unqualified-id before ‘else’
> /usr/include/c++/4.1.2/bits/stl_multimap.h:142: error: expected identifier before ‘}’ token
> /usr/include/c++/4.1.2/bits/stl_multimap.h:142: error: expected unqualified-id before ‘}’ token
> /usr/include/c++/4.1.2/bits/stl_multimap.h:142: error: expected unqualified-id before ‘else’
> make: *** [/home/dart/src/dartnms/obj/main.o] Error 1
>
> Thanks, Dave
>
>
> -----Original Message-----
> From: Tom Browder [mailto:tom.browder@gmail.com]
> Sent: Tuesday, February 12, 2008 4:23 PM
> To: David Arthur
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: STL problems in GCC 4.1.2
>
> On 2/12/08, David Arthur <darthur@tantacomm.com> wrote:
> ...
> > I am trying to compile an app under gcc 4.1.2 and I get _loads_ of STL
> > errors, relating to templates in STL headers that are unhappy. The strange
> > thing is that all compiles beautifully under gcc 3.3.3! I have found that
>
> Lots of changes, and tightening of user code required, from 3.3.3 to 4.1.2.
>
> How about posting a couple of the error messages so we can see what
> kinds of errors you're talking about.
>
> -Tom
>
>


Like Tom said you need to explicitly include header files for all STL
constructs you use and indeed for any function you use from any header
file.

Gcc 4.x.x has made these rules very strict.
You are compiling with -Wall and -Werror right?


I would worry about using -fpermissive can you remove this option and
fix any problems that may arise?

Regards,
JT

  reply	other threads:[~2008-02-12 23:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 22:11 David Arthur
2008-02-12 22:23 ` Tom Browder
2008-02-12 22:46   ` David Arthur
2008-02-12 23:20     ` James Tebneff [this message]
2008-02-14 22:23       ` David Arthur
2008-02-21 18:14       ` David Arthur
     [not found]         ` <C3E329D4.1C1C%eljay@adobe.com>
2008-02-21 19:27           ` David Arthur
2008-02-21 19:43             ` Eljay Love-Jensen
2008-02-21 20:08               ` David Arthur
2008-02-21 20:17                 ` Eljay Love-Jensen
2008-02-21 22:59                   ` Tom Browder
2008-02-22  9:08                     ` Tom Browder
2008-02-21 22:59                   ` Tom Browder
2008-02-25 14:53                 ` Philipp Thomas

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=359fcc390802121520j8b7102n8d7ac94f9dd919bb@mail.gmail.com \
    --to=tebneff@gmail.com \
    --cc=darthur@tantacomm.com \
    --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).