FMC
Member #4,431
March 2004
|
Pretty mysterious linking error: 1 | Compiler: Default compiler | 2 | Building Makefile: "C:\DevCpp\Programmi\ctris\Makefile.win" | 3 | Executing make... | 4 | make.exe -f "C:\DevCpp\Programmi\ctris\Makefile.win" all | 5 | gcc.exe -c gfx_misc.cpp -o gfx_misc.o -I"C:/DevCpp/include" -O3 | 6 | | 7 | gcc.exe main.o resources.o timer.o gfx.o board.o gfx_misc.o -o "ctris.exe" -L"C:/DevCpp/lib" -lfblend -lalleg | 8 | | 9 | gfx_misc.o(.text+0xaf):gfx_misc.cpp: undefined reference to `operator delete(void*)' | 10 | gfx_misc.o(.text+0xbb):gfx_misc.cpp: undefined reference to `operator delete(void*)' | 11 | gfx_misc.o(.text+0xeb):gfx_misc.cpp: undefined reference to `__gxx_personality_sj0' | 12 | gfx_misc.o(.text+0x114):gfx_misc.cpp: undefined reference to `operator new(unsigned int)' | 13 | gfx_misc.o(.text+0x222):gfx_misc.cpp: undefined reference to `operator delete(void*)' | 14 | gfx_misc.o(.text+0x22d):gfx_misc.cpp: undefined reference to `operator delete(void*)' | 15 | | 16 | gfx_misc.o(.text$_ZNSt6vectorI8particleSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<particle, std::allocator<particle> >::_M_insert_aux(__gnu_cxx::__normal_iterator<particle*, std::vector<particle, std::allocator<particle> > >, particle const&)]+0x140):gfx_misc.cpp: undefined reference to `operator new(unsigned int)' | 17 | gfx_misc.o(.text$_ZNSt6vectorI8particleSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_[std::vector<particle, std::allocator<particle> >::_M_insert_aux(__gnu_cxx::__normal_iterator<particle*, std::vector<particle, std::allocator<particle> > >, particle const&)]+0x27f):gfx_misc.cpp: undefined reference to `operator delete(void*)' | 18 | collect2: ld returned 1 exit status | 19 | | 20 | make.exe: *** [ctris.exe] Error 1 | 21 | | 22 | Execution terminated |
And this is the snipped-down code that generates the error:
1 | class particle{ | 2 | float x,y, vx, vy; | 3 | int type, life, col, size; | 4 | public: | 5 | particle(int t, float _x, float _y){ | 6 | ... | 7 | } | 8 | void draw(BITMAP *buf){ | 9 | ... | 10 | } | 11 | int update(){ | 12 | ... | 13 | } | 14 | }; | 15 | | 16 | class ccomet { | 17 | vector<particle> trail; | 18 | int x,y; | 19 | public: | 20 | ccomet(int a, int b){ | 21 | x = a; | 22 | y = b; | 23 | for(int x=0; x<100; x++){ | 24 | trail.push_back(particle(tCOMET, (float)x, (float)y)); | 25 | } | 26 | } | 27 | void draw(BITMAP *buf){ | 28 | for(int x=0; x<trail.size(); x++){ | 29 | trail[x].draw(buf); | 30 | } | 31 | } | 32 | void update(){ | 33 | vector<particle>::iterator p; | 34 | for(p = trail.begin(); p!=trail.end(); p++){ | 35 | if(p->update()){//is dead | 36 | trail.erase(p); | 37 | p--; | 38 | } | 39 | } | 40 | } | 41 | ~ccomet(){ | 42 | trail.empty(); | 43 | } | 44 | | 45 | }*com; |
It actually compiled fine, but as soon as i added com = new ccomet(20,20); that nasty error popped out. Its been quite some time from the last time i programmed, so it could be something stupid...
[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] Written laws are like spiders' webs, and will, like them, only entangle and hold the poor and weak, while the rich and powerful will easily break through them. -Anacharsis Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover. -Mark Twain
|