I have three source files. main.cpp, globals.cpp and O_Bullet.cpp. My header files are Gloabls.h and O_Bullet.h.
Bullet is a class with the header in O_Bullet.h and the funcitons in O_Bullet.cpp.
Within Globals.h I declare:
extern Bullet bullets[];
Within Globals.cpp:
Bullet bullets[10];
and finally in Main.cpp I include globals.h and create the actual instances of the Bullets.
for(int t = 0; t < 10; t++)
bullets[t] = Bullet::Bullet(240,160,270,200.0f,1.0f);
I get the follwing link error:
globals.o: In function '__static_initialization_and)destruction_0(int, int):globals.o(.text+0x50c): undefined reference to '__gxx_personality_sj0'
collect2: ld returned 1 exit status
I'm thinking that perhaps I get this error because I've got an array of 'Bullet'. I also have a similar class 'Ship' and an instance declared and created in the exact same way except there is no array and that works fine.
Can someone help me here?
Thanks in advance
slip
[edited by - slip on January 30, 2003 11:45:59 PM]