This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: STL problems in GCC 4.1.2


Thanks much for your help!
I have made sure that I am including each STL header that I use anything from, in the source or header file where it is used.
I am now compiling with -Wall and -Werror, and have removed -fpermissive's.
Here are some of the errors I am still seeing:

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 -Wall -Werror -c -o /home/dart/src/dartnms/obj/dartnms.o /home/dart/src/dartnms/src/dartnms.cpp
/usr/include/c++/4.1.2/bits/stl_list.h:297: error: expected identifier before ÃâË}Ãââ token
/usr/include/c++/4.1.2/bits/stl_list.h:297: error: expected unqualified-id before ÃâË}Ãââ token
/usr/include/c++/4.1.2/bits/stl_list.h:297: error: expected unqualified-id before ÃâËelseÃââ
/usr/include/c++/4.1.2/bits/stl_list.h:300: error: expected unqualified-id before ÃâËelseÃââ
/usr/include/c++/4.1.2/bits/list.tcc:69: error: no ÃâËvoid std::_List_base<_Tp, _Alloc>::_M_clear()Ãââ member function declared in class ÃâËstd::_List_base<_Tp, _Alloc>Ãââ
/usr/include/c++/4.1.2/bits/list.tcc:69: error: template definition of non-template ÃâËvoid std::_List_base<_Tp, _Alloc>::_M_clear()Ãââ
/usr/include/c++/4.1.2/bits/list.tcc: In member function ÃâËvoid std::_List_base<_Tp, _Alloc>::_M_clear()Ãââ:
/usr/include/c++/4.1.2/bits/list.tcc:77: error: there are no arguments to ÃâË_M_get_Tp_allocatorÃââ that depend on a template parameter, so a declaration of ÃâË_M_get_Tp_allocatorÃââ must be available
/usr/include/c++/4.1.2/bits/list.tcc:77: error: (if you use ÃâË-fpermissiveÃââ, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/usr/include/c++/4.1.2/bits/stl_list.h: At global scope:
/usr/include/c++/4.1.2/bits/stl_list.h: In instantiation of ÃâËstd::list<AppTimer*, std::allocator<AppTimer*> >Ãââ:
/home/dart/src/plugappsdk/include/appTimer.h:171:   instantiated from here
/usr/include/c++/4.1.2/bits/stl_list.h:406: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:410: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:411: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:412: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:413: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:433: error: no members matching ÃâËstd::_List_base<AppTimer*, std::allocator<AppTimer*> >::_M_implÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:434: error: no members matching ÃâËstd::_List_base<AppTimer*, std::allocator<AppTimer*> >::_M_put_nodeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:435: error: no members matching ÃâËstd::_List_base<AppTimer*, std::allocator<AppTimer*> >::_M_get_nodeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:436: error: no members matching ÃâËstd::_List_base<AppTimer*, std::allocator<AppTimer*> >::_M_get_Tp_allocatorÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:683: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:691: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:699: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:711: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<AppTimer*, std::allocator<AppTimer*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_vector.h:78: error: expected identifier before ÃâË}Ãââ token
/usr/include/c++/4.1.2/bits/stl_vector.h:78: error: expected unqualified-id before ÃâË}Ãââ token
/usr/include/c++/4.1.2/bits/stl_vector.h:78: error: expected unqualified-id before ÃâËelseÃââ
/usr/include/c++/4.1.2/bits/stl_bvector.h:359: error: expected identifier before ÃâË}Ãââ token
/usr/include/c++/4.1.2/bits/stl_bvector.h:359: error: expected unqualified-id before ÃâË}Ãââ token
/usr/include/c++/4.1.2/bits/stl_bvector.h:359: error: expected unqualified-id before ÃâËelseÃââ
/usr/include/c++/4.1.2/bits/stl_list.h: In instantiation of ÃâËstd::list<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ:
/home/dart/src/plugappsdk/include/fileConfig.h:113:   instantiated from here
/usr/include/c++/4.1.2/bits/stl_list.h:406: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:410: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:411: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:412: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:413: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:433: error: no members matching ÃâËstd::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >::_M_implÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:434: error: no members matching ÃâËstd::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >::_M_put_nodeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:435: error: no members matching ÃâËstd::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >::_M_get_nodeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:436: error: no members matching ÃâËstd::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >::_M_get_Tp_allocatorÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:683: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:691: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:699: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h:711: error: no type named ÃâË_Tp_alloc_typeÃââ in ÃâËclass std::_List_base<FileIniEntry*, std::allocator<FileIniEntry*> >Ãââ
/usr/include/c++/4.1.2/bits/stl_list.h: In instantiation of ÃâËstd::list<FileConfEntry*, std::allocator<FileConfEntry*> >Ãââ:

[snip...]

It looks like repeats of the above for each object module involved that uses STL functionality.

Any ideas?

Thanks again, Dave


-----Original Message-----
From: James Tebneff [mailto:tebneff@gmail.com] 
Sent: Tuesday, February 12, 2008 5:20 PM
To: David Arthur
Cc: gcc-help@gcc.gnu.org
Subject: Re: STL problems in GCC 4.1.2

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]