PDA

View Full Version : Compilation errors with C++ libraries (game-porting)



stevenh
February 18th, 2008, 07:52
To all, have just decided to dust off my dreamcast after finding a Train controller, keyboard, mouse and VMU-Microphone in Japan to use with it.

I thought it'd be a fun challenge to port a game over to the DC though am having some issues compiling.. have been slowing hacking through the code to make it fit the DC but it seems that I've found the file-handling procedures which want STL Libraries? GCC then doesn't know what to do with itself:


fileio.o(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairI KSs16TarFileListEntryESt10_Select1stIS3_ESt4lessIS sESaIS3_EE8_M_eraseEPSt13_Rb_tree_nodeIS3_E+0x84):
In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry> >,
std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry> > >::_M_erase(std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry> >*)':
/usr/local/dc/sh-elf/lib/gcc/sh-elf/3.4.6/../../../../include/c++/3.4.6/bits/stl_tree.h:470:
undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'

^^ my cool error... G++ is having a tiff with it's own headers and since it's in the linking stage it's obvious I have left out a library but as to which one I don't know...

I suppose I just need to know what 'standard C' libraries I can use with KOS/sh-elf and what I can't...

Another chunk of error text from the same linking session:


fileio.o(.gnu.linkonce.t._ZNSt8_Rb_treeISsSt4pairI KSs16TarFileListEntryESt10_Select1stIS3_ESt4lessIS sESaIS3_EE13insert_uniqueERKS3_+0x194):
In function `std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry> > >::insert_unique(std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, TarFileListEntry> const&)':

/usr/local/dc/openttd/src/fileio.cpp:98: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*) '


Any insight would be greatly appreciated!

stevenh
February 27th, 2008, 03:01
OK, The above issue was repaired by linking in all the proper libraries... order seemed to make a difference.

I'm now curious about endian support... does the KOS library load the CPU in little or big endian? Because I know the bin2o romdisk image creator creates a little-endian image and this is starting to confuse the hell out of me...

If anyone can shed light on why I am getting so confused then I'd be greatly appreciative...

Elven6
March 13th, 2008, 00:16
What compiler are you using?