Welcome! Log In Create A New Profile

Advanced

WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.

Posted by vader347 
WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
July 31, 2008 08:47PM
I am working on a DOSBox port and I am having some linking errors.
Just incase anyone wants to know what I did here it is.
1. Downloaded and upacked Dosbox .72 source
2. Download SDL-Port to Wii.
3. Copied over Makefile and edited config.h to work with devkitPPC.
4. Went through and converted program from dirent.h to sys/dir.h and libfat
5. Fixed a couple of small problems.

I ended up with two link errors
zach@zach-laptop:~/Desktop/wii/WiiDos$ make
linking ... WiiDos.elf
cdrom_image.o: In function `CDROM_Interface_Image::LoadCueSheet(char*)':
/home/zach/Desktop/wii/WiiDos/src/dos/cdrom_image.cpp:413: undefined reference to `dirname'
drive_local.o: In function `localFile::Write(unsigned char*, unsigned short*)':
/home/zach/Desktop/wii/WiiDos/src/dos/drive_local.cpp:466: undefined reference to `ftruncate'
collect2: ld returned 1 exit status
make[1]: *** [/home/zach/Desktop/wii/WiiDos/WiiDos.elf] Error 1
make: *** [build] Error 2
Aparently this means that devkitPPC doesn't support truncate/ftruncate and dirname. If there is a replacement or a solution please post.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 01, 2008 02:03AM
hi,

dkppc uses newlib as its libc. its implementation is not complete, and you just ran into this problem. the two mentioned functions are defined in the newlib headers, but are not implemented for the dolphin/revolution platform. this is why you get linker errors in contrast to a compiler error.

solution: you have to replace those functions calls with your own implementations, but these two should be trivial.

i ran into similar situations on the mplayer port, does the code using those function even make sense on the wii? will it even be called? maybe it's safe to #ifdef those out, thats for you to decide ;)

regards,
dhewg
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 01, 2008 02:19AM
commenting/ifdef was what I am thinking of doing. We don't have a cdrom drive or a internal drives so I think I can get away with it.
I don't think that they are that important. dirname looks easy to implement and ftruncate won't take long either.
I was hoping I did something wrong though.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 01, 2008 02:22AM
I guess ISO support can be in another release.
Now to ftruncate.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 01, 2008 01:20PM
Is there an SVN / CVS repo for this project? (sorry if i have missed it somewhere)
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 03, 2008 07:32PM
I am making some progress and will have a SVN up soon.

If anyone knows where I can contact ravenexus or Frans-Wii please tell me.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 05, 2008 04:10AM
I got everything to compile now I get a black screen.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 05, 2008 04:50AM
LOL. Check to make sure the video is initialized properly, and such, and that you don't have an infinite loop before it finishes initializing.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 05, 2008 05:11AM
Perhaps post the source...
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 05, 2008 03:49PM
Make sure you have your loader properly initialized.
Re: WiiDos. Problems with, dirent.h, uinstd.h, libgen.h and others.
August 11, 2008 02:22AM
Can't wait to play Commander Keen on my Wii :P

The ultimate irony here is that it all started as a proposal to bring SMB3 to PC... so things just kind of pull a 180 if we ever get a Wii version of DosBox.
Sorry, only registered users may post in this forum.

Click here to login