This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: error: 'comp' was not declared in this scope
- From: "Divy Kanungo" <divyk at bgnet dot bgsu dot edu>
- To: "John Love-Jensen" <eljay at adobe dot com>, gcc-help at gcc dot gnu dot org
- Date: Wed, 14 Feb 2007 14:46:20 -0500
- Subject: Re: error: 'comp' was not declared in this scope
Hi Eljay,
Thanks for reply. Using your proposed solution solved the
problem of c and comp not being declared in scope. So, is it
that the new gcc version does not allow directly using the
protected variabled declared in parent class? (because that
worked fine when I had gcc 3.4.3)
Also now I have new issues when I compile the program. I get the
following linker errors:
/usr/local/lib/libbg.so: undefined reference to
`std::__default_alloc_template<true, 0>::allocate(unsigned int)'
/usr/local/lib/libbg.so: undefined reference to
`std::basic_streambuf<char, std::char_traits<char>
>::_M_out_cur_move(long)'
/usr/local/lib/libbg.so: undefined reference to
`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_create(unsigned int,
std::allocator<char> const&)'
/usr/local/lib/libbg.so: undefined reference to
`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_empty_rep_storage'
/usr/local/lib/libbg.so: undefined reference to
`std::__default_alloc_template<true, 0>::deallocate(void*,
unsigned int)'
collect2: ld returned 1 exit status
I am not sure why these are appearing. How can solve the above
problems.
Divy.
---------Included Message----------
>Date: 14-Feb-2007 07:23:38 -0500
>From: "John Love-Jensen" <eljay@adobe.com>
>To: "Divy Kanungo" <divyk@bgnet.bgsu.edu>, "MSX to GCC" <gcc-
help@gcc.gnu.org>
>Subject: Re: error: 'comp' was not declared in this scope
>
>Hi Divy,
>
>You might want to try adding this near the beginning of your
Queue template
>class:
>
>protected:
> using std::priority_queue< T, std::vector<T>, PLess<T> >::c;
> using std::priority_queue< T, std::vector<T>, PLess<T>
>::comp;
>
>HTH,
>--Eljay
>
>
>
---------End of Included Message----------