Addictgamer Posted March 12, 2010 Share Posted March 12, 2010 Why does this occur when I try to compile an application with sdl in GCC? After further testing, I see I accidentally did typos in the compilation. But these errors remained, and a few others... Yes, I installed the libraries and headers correctly. Link to comment Share on other sites More sharing options...
Addictgamer Posted March 12, 2010 Author Share Posted March 12, 2010 Ah, the problem was that I had given mingw .lib files instead of .a Now sdl programs compile. I just need .a files of all my other libraries. Hope this helps all mingw beginners. Link to comment Share on other sites More sharing options...
Addictgamer Posted March 15, 2010 Author Share Posted March 15, 2010 New error C:\Users\BEST_A~1\AppData\Local\Temp/ccrOjdSD.o:sprites.cpp:(.text+0x140): undef ined reference to `std::ios_base::Init::~Init()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0xd): undefi ned reference to `std::string::size() const' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x60): undef ined reference to `std::string::operator[](unsigned int) const' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x9e): undef ined reference to `std::string::operator[](unsigned int) const' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0xcc): undef ined reference to `std::string::operator[](unsigned int) const' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x188): unde fined reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x1b3): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x1b8): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x1cc): unde fined reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x1d4): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x1dc): unde fined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x1e1): unde fined reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x20c): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x211): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x225): unde fined reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x22d): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x235): unde fined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x23a): unde fined reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x265): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x26a): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x27e): unde fined reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x286): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x28e): unde fined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x293): unde fined reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x2be): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x2c3): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x2d7): unde fined reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x2df): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl <char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x2e7): unde fined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x2fd): unde fined reference to `__gxx_personality_sj0' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x333): unde fined reference to `std::allocator<char>::allocator()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x354): unde fined reference to `std::basic_string<char, std::char_traits<char>, std::allocat or<char> >::basic_string(char const*, std::allocator<char> const&)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x397): unde fined reference to `std::basic_string<char, std::char_traits<char>, std::allocat or<char> >::~basic_string()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x3b1): unde fined reference to `std::basic_string<char, std::char_traits<char>, std::allocat or<char> >::~basic_string()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x3c4): unde fined reference to `std::allocator<char>::~allocator()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x3e7): unde fined reference to `std::allocator<char>::~allocator()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x3fc): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x408): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x491): unde fined reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x4a0): unde fined reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x4b7): unde fined reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x4c6): unde fined reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x4ee): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x4f3): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x517): unde fined reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x51c): unde fined reference to `std::basic_ostream<char, std::char_traits<char> >& std::oper ator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x547): unde fined reference to `std::ios_base::Init::Init()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text+0x562): unde fined reference to `std::ios_base::Init::~Init()' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x23): undefined reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x3e): undefined reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x43): undefined reference to `SCREEN_W IDTH' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x6d): undefined reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x85): undefined reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x8a): undefined reference to `SCREEN_H EIGHT' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0x96): undefined reference to `screen' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0xac): undefined reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cci0SknQ.o:toolshed.cpp:(.text$_ZN8toolshed 11draw_spriteEv[toolshed::draw_sprite()]+0xc0): undefined reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0xd): undefine d reference to `std::string::size() const' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x60): undefin ed reference to `std::string::operator[](unsigned int) const' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x9e): undefin ed reference to `std::string::operator[](unsigned int) const' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0xcc): undefin ed reference to `std::string::operator[](unsigned int) const' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x11e): undefi ned reference to `screen' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x129): undefi ned reference to `SDL_MapRGB' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x132): undefi ned reference to `screen' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x13e): undefi ned reference to `screen' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x146): undefi ned reference to `SDL_FillRect' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x14d): undefi ned reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x152): undefi ned reference to `SDL_PollEvent' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x15c): undefi ned reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x165): undefi ned reference to `gameover' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x16c): undefi ned reference to `GameState' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x175): undefi ned reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x17e): undefi ned reference to `event_struct' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x195): undefi ned reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x1a3): undefi ned reference to `gameover' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x1aa): undefi ned reference to `GameState' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x1c3): undefi ned reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x1d0): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x1df): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x1f5): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x202): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x21b): undefi ned reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x220): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::operat or<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x22c): undefi ned reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x234): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<c har, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >& )' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x23c): undefi ned reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x241): undefi ned reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x24e): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x25d): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x273): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x280): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x299): undefi ned reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x29e): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::operat or<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2aa): undefi ned reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2b2): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<c har, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >& )' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2ba): undefi ned reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2bf): undefi ned reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2cc): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2dc): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2f1): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x2fe): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x317): undefi ned reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x31c): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::operat or<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x328): undefi ned reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x330): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<c har, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >& )' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x338): undefi ned reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x33d): undefi ned reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x34a): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x35a): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x36f): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x37c): undefi ned reference to `PCamera' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x395): undefi ned reference to `std::cout' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x39a): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::operat or<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x3a6): undefi ned reference to `std::ostream::operator<<(int)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x3ae): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<c har, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >& )' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x3b6): undefi ned reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x3bb): undefi ned reference to `keystates' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x3e5): undefi ned reference to `screen' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x3ed): undefi ned reference to `SDL_Flip' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x401): undefi ned reference to `std::cerr' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x406): undefi ned reference to `std::basic_ostream<char, std::char_traits<char> >& std::operat or<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const*)' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x441): undefi ned reference to `std::ios_base::Init::Init()' C:\Users\BEST_A~1\AppData\Local\Temp/cc38rI6v.o:update.cpp:(.text+0x45c): undefi ned reference to `std::ios_base::Init::~Init()' collect2: ld returned 1 exit status c:\source\ORR> It filled several console screens, so I couldn't copy it all. But this is basically all that is outputted. Link to comment Share on other sites More sharing options...
Anonymouse Posted March 19, 2010 Share Posted March 19, 2010 Looks like it can't find the standard library o.O Link to comment Share on other sites More sharing options...
Addictgamer Posted March 19, 2010 Author Share Posted March 19, 2010 Ya, I fixed it all. Now I am back to undefined reference to object in the python library. >:( Link to comment Share on other sites More sharing options...
Anonymouse Posted March 20, 2010 Share Posted March 20, 2010 Errorz and codez plz? z. Link to comment Share on other sites More sharing options...
Acmex Posted March 20, 2010 Share Posted March 20, 2010 Also, please put it in a text file attached to your post or on pastebin, kthxbai Link to comment Share on other sites More sharing options...
Addictgamer Posted March 21, 2010 Author Share Posted March 21, 2010 Fixed. Used a make file. Makefile: ) # Same for the .d (dependancy) files. DFILES := $(addprefix $(STORE)/,$(SOURCE:.cpp=.d)) # Specify phony rules. These are rules that are not real files. .PHONY: clean backup dirs # Main target. The @ in front of a command prevents make from displaying # it to the standard output. $(TARGET): dirs $(OBJECTS) @echo Linking $(TARGET). @$(C++) -o $(TARGET) $(OBJECTS) $(LDPARAM) $(foreach LIBRARY, \ $(LIBS),-l$(LIBRARY)) $(foreach LIB,$(LIBPATH),-L$(LIB)) # Rule for creating object file and .d file, the sed magic is to add # the object path at the start of the file because the files gcc # outputs assume it will be in the same dir as the source file. $(STORE)/%.o: %.cpp @echo Creating object file for $*... @$(C++) -Wp,-MMD,$(STORE)/$*.dd $(CCPARAM) $(foreach INC,$(INCPATH),-I$(INC))\ $(foreach MACRO,$(MACROS),-D$(MACRO)) -c $< -o $@ @sed -e '1s/^\(.*\)$$/$(subst /,\/,$(dir $@))\1/' $(STORE)/$*.dd > $(STORE)/$*.d @del -f $(STORE)/$*.dd # Empty rule to prevent problems when a header is deleted. %.hpp: ; # Cleans up the objects, .d files and executables. clean: @echo Making clean. @-del -f $(foreach DIR,$(DIRS),$(STORE)/$(DIR)/*.d $(STORE)/$(DIR)/*. @-del -f $(TARGET) # Backup the source files. backup: @-if [ ! -e .backup ]; then mkdir .backup; fi; @zip .backup/backup_`date +%d-%m-%y_%H.%M`.zip $(SOURCE) $(HEADERS) $(EXTRA_FILES) # Create necessary directories dirs: @-if [ ! -e $(STORE) ]; then mkdir $(STORE); fi; @-$(foreach DIR,$(DIRS), if [ ! -e $(STORE)/$(DIR) ]; \ then mkdir $(STORE)/$(DIR); fi; ) # Includes the .d files so it knows the exact dependencies for every # source. -include $(DFILES) # Specify the main target TARGET = main # Default build type TYPE = release # Which directories contain source files DIRS = . engine game # Which libraries are linked LIBS = mingw32 SDL SDLmain SDL_image SDL_ttf SDL_mixer SDL_ffmpeg python26 # Dynamic libraries DLIBS = # The next blocks change some variables depending on the build type ifeq ($(TYPE),debug) LDPARAM = CCPARAM = -Wall -g MACROS = endif ifeq ($(TYPE),profile) LDPARAM = -pg /lib/libc.so.5 CCPARAM = -Wall -pg MACROS = NDEBUG endif ifeq ($(TYPE), release) LDPARAM = -s CCPARAM = -Wall -O2 MACROS = NDEBUG endif # Add directories to the include and library paths INCPATH = c:\Python26\include\ LIBPATH = c:\Python26\libs\ # Which files to add to backups, apart from the source code EXTRA_FILES = Makefile # The compiler C++ = g++ # Where to store object and dependancy files. STORE = .make-$(TYPE) # Makes a list of the source (.cpp) files. SOURCE := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.cpp)) # List of header files. HEADERS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.hpp)) # Makes a list of the object files that will have to be created. OBJECTS := $(addprefix $(STORE)/, $(SOURCE:.cpp=. New error: ! was unexpected at this time. mingw32-make: [dirs] Error 255 (ignored) ! was unexpected at this time. mingw32-make: [dirs] Error 255 (ignored) Creating object file for engine/EbClassUnit... engine/EbClassUnit.cpp:113: fatal error: opening dependency file .make-release/e ngine/EbClassUnit.dd: No such file or directory compilation terminated. mingw32-make: *** [.make-release/engine/EbClassUnit.o] Error 1 There may be a simple fix for this. I am just starting out with make files. EDIT: Didn't see your post acmex, had the posting form open since early this morning, and just posted it now What do you mean? Link to comment Share on other sites More sharing options...
Acmex Posted March 21, 2010 Share Posted March 21, 2010 Instead of making the posts REALLY long, try to paste the output into a text file and upload that or on to pastebin and then link it here. Link to comment Share on other sites More sharing options...
Addictgamer Posted March 21, 2010 Author Share Posted March 21, 2010 Oh wait, I forgot this forum had spoilers, unlike gamedev. Link to comment Share on other sites More sharing options...
Anonymouse Posted March 22, 2010 Share Posted March 22, 2010 http://paste.pocoo.org/ is a better option still, mainly because it has syntax highlighting. Link to comment Share on other sites More sharing options...
Acmex Posted March 23, 2010 Share Posted March 23, 2010 Actually, pastebin does have syntax highlighting. It changes according to the programming language, too :P Link to comment Share on other sites More sharing options...
Anonymouse Posted March 24, 2010 Share Posted March 24, 2010 Actually, pastebin does have syntax highlighting. It changes according to the programming language, too Who cares? paste.pocoo.org's changes too, and there are no ads (ABP, I know, but some people don't have it) And it just looks better. :P Link to comment Share on other sites More sharing options...
Recommended Posts