gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Libfat and DIR_ITER

#160233 - ferrand.d - Sat Jul 12, 2008 1:11 pm

Hi everybody !
I'm french so please excuse me for my bad english. I'm trying to compile a project which uses libfat, but this is a very old project, so I think many things have changed in two years.

The error I get is
Quote:
error: 'DIR_ITER' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: for each function it appears in.)
error: 'd' undeclared (first use in this function)


And my (simplified) source code is
Code:
#include <nds.h>

#include <fat.h>

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/dir.h>

// ...

DIR_ITER* d;


Actually, I don't know where does the DIR_ITER come from and even trying to compile the example code given by chishm on his website, I got that error !
I think the error comes from the header sys/dir.h, but I didn't really understand the POSIX/non-POSIX point.

I'm totally lost so please help me !

#160237 - Sektor - Sat Jul 12, 2008 4:21 pm

The simplified code you pasted compiles fine here:

I'm using:

devkitARM_r23b
libnds-20071023
libfat-nds-20070127

I have C:\devkitPro\devkitARM\arm-eabi\include\sys\dir.h and it is required for DIR_ITER.

I suggest you reinstall the devkit or post a link to the project and I'll take a look.
_________________
GTAMP.com/DS

#160238 - ferrand.d - Sat Jul 12, 2008 5:05 pm

Thanks to you, I've found the problem !
Actually I'm under Linux and I have two different versions of the header sys/dir.h :
- /usr/include/sys/dir.h
- [my personal folder]/devkitpro/devkitARM/arm-eabi/include/sys/dir.h

I think the compiler includes only the version of the system, and that's why he doesn't recognizes DIR_ITER ! But now the question is : how to tell him to include the second version ?!

Thanks for everything ;)