I've Tried And Tried And Tried...


sand_man

Active Member
Joined
Nov 4, 2005
Messages
727
I keep getting strange errors when compiling with devkitgp2x

Code:
Project   : 1942 Clone
Compiler  : GNU GCC Compiler (called directly)
Directory : D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone\
--------------------------------------------------------------------------------
Switching to target: arm-linux-dbg
Compiling: CPlayer.cpp
Compiling: CText.cpp
Compiling: main.cpp
Compiling: CApp.cpp
Linking console executable: 1942 clone.exe
.objs\CPlayer.o: In function `CPlayer::LoadIMG(char*, SDL_Surface*)':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:6: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:6: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:6: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:10: undefined reference to `std::cout'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:10: undefined 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> >&)'
.objs\CPlayer.o: In function `~CPlayer':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:40: undefined reference to `__gxx_personality_sj0'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:40: undefined reference to `__gxx_personality_sj0'
.objs\CPlayer.o: In function `CPlayer':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:21: undefined reference to `__gxx_personality_sj0'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CPlayer.cpp:21: undefined reference to `__gxx_personality_sj0'
.objs\CPlayer.o: In function `__static_initialization_and_destruction_0':
D:\devkitGP2X\include\c++\4.0.2/iostream:76: undefined reference to `std::ios_base::Init::Init()'
D:\devkitGP2X\include\c++\4.0.2/iostream:76: undefined reference to `std::ios_base::Init::~Init()'
.objs\CPlayer.o: In function `__gnu_cxx::new_allocator<vec_2D>::deallocate(vec_2D*, unsigned int)':
D:\devkitGP2X\include\c++\4.0.2/ext/new_allocator.h:94: undefined reference to `operator delete(void*)'
.objs\CPlayer.o: In function `__gnu_cxx::new_allocator<vec_2D>::allocate(unsigned int, void const*)':
D:\devkitGP2X\include\c++\4.0.2/ext/new_allocator.h:86: undefined reference to `std::__throw_bad_alloc()'
D:\devkitGP2X\include\c++\4.0.2/ext/new_allocator.h:88: undefined reference to `operator new(unsigned int)'
.objs\CPlayer.o: In function `std::vector<vec_2D, std::allocator<vec_2D> >::_M_insert_aux(__gnu_cxx::__normal_iterator<vec_2D*, std::vector<vec_2D, std::allocator<vec_2D> > >, vec_2D const&)':
D:\devkitGP2X\include\c++\4.0.2/bits/vector.tcc:266: undefined reference to `std::__throw_length_error(char const*)'
.objs\CText.o: In function `CText':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:4: undefined reference to `TTF_Init'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:5: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:5: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:5: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:9: undefined reference to `TTF_OpenFont'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:11: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:11: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:11: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:18: undefined reference to `std::cerr'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:18: undefined 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> >&)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:4: undefined reference to `TTF_Init'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:5: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:5: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:5: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:9: undefined reference to `TTF_OpenFont'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:11: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:11: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:11: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:18: undefined reference to `std::cerr'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:18: undefined 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> >&)'
.objs\CText.o: In function `~CText':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:22: undefined reference to `TTF_CloseFont'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:25: undefined reference to `TTF_Quit'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:22: undefined reference to `TTF_CloseFont'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:25: undefined reference to `TTF_Quit'
.objs\CText.o: In function `CText::DrawText(SDL_Surface*, char*, short, short)':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:35: undefined reference to `TTF_RenderText_Solid'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:36: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:36: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:36: undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:42: undefined reference to `std::cerr'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/CText.cpp:42: undefined 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> >&)'
.objs\CText.o: In function `__static_initialization_and_destruction_0':
D:\devkitGP2X\include\c++\4.0.2/iostream:76: undefined reference to `std::ios_base::Init::Init()'
D:\devkitGP2X\include\c++\4.0.2/iostream:76: undefined reference to `std::ios_base::Init::~Init()'
.objs\main.o: In function `events()':
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/main.cpp:50: undefined reference to `__cxa_guard_acquire'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/main.cpp:50: undefined reference to `__cxa_guard_release'
D:\Documents and Settings\Ty.N-0A75495987384\My Documents\1942 clone/main.cpp:50: undefined reference to `__cxa_guard_abort'
Process terminated with status 1 (0 minutes, 3 seconds)
52 errors, 0 warnings

The code compile fine in with mingw.
It looks like it can't find the right header files but I just don't know what to do.
 
Sounds to me like your compiling c++ code without including the c++ libraries? (don't ask me what they are though, as I don't do c++ on embedded platforms).

Oh, and a more appropriate subject line would have been nice :p
 
Have you put the correct paths in the PATH environment variable (System > Advanced > Env Variables)?
 
I fixed it.
in case you were wondering it was the libstdc++.a lib
But I still can't compile it because there is no SDL_ttf in the devkitgp2x pkg
 
Back
Top