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]

Re: is STL usable with gcc 3.0?


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


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