is STL usable with gcc 3.0?

Brent Phillips brent@lyrastudios.com
Thu Aug 16 16:28:00 GMT 2001


Hi,

Sorry to send so much email to this list, but I've been having a really 
horrible with gcc 3.0...the latest is problems getting STL to work with gcc 
3.0. On my system (RedHat Linux, RedHat Linux 2.2.18), a basic "hello 
world" that uses STL crashes in a variety of ways. Take your basic "hello 
world" program...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
int main(int argc, char** argv) {
   printf("hello world!\n");  exit(0);
}

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

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.

3) adding the lines

typedef std::vector<int> mytype_t;

mytype_t myvector;

yields the error

/tmp/cc2HrKVq.o: In function `__FRAME_BEGIN__':
/tmp/cc2HrKVq.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

Please advise...this is driving me insane!

thanks so much

Brent








More information about the Gcc-help mailing list