This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: is STL usable with gcc 3.0?
- To: Brent Phillips <brent at lyrastudios dot com>
- Subject: Re: is STL usable with gcc 3.0?
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 16 Aug 2001 22:22:34 -0300
- Cc: gcc-help at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <5.1.0.14.2.20010816162106.03c96bb0@lyrastudios.com>
On Aug 16, 2001, Brent Phillips <brent@lyrastudios.com> wrote:
> compiled with default options ("gcc hello.cpp")...
> 1) adding the line
> std::vector<int> myvector;
> yields the error
> /tmp/cctISmpm.o: In function `__FRAME_BEGIN__':
> /tmp/cctISmpm.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
> collect2: ld returned 1 exit status
Use g++ to link C++ code, so that libstdc++ is implicitly linked in.
Some C++-specific symbols that used to be in libgcc were moved to
libstdc++ in GCC 3.0.
> 2) adding the line
> vector<int> myvector;
> yields the error
> hello.cpp:7: 'vector' is used as a type, but is not defined as a type.
std:: is significant in GCC 3.0, and <vector> declares only
std::vector, unlike <vector.h>, that brings std::vector into the
global namespace.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me