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.

Beginners > "(file) does not have a DLDI section"

#170094 - wallacoloo - Sun Aug 30, 2009 12:42 am

I'm trying to get libfat to work on my GBA.
I am following this tutorial.

I made a quick program that tries to initialize libFat and create a new file. I added some tests that check to make sure that libfat initialized correctly:
Code:
#include <stdio.h>
#include <fat.h>

unsigned short* Screen = (unsigned short*)0x6000000;
void setRed() {
    int i = 0;
    while(i < 38400) {
            Screen[i] = 31;
            i++;
    }
}
void setWhite() {
    int i = 0;
    while(i < 38400) {
            Screen[i] = 32767;
            i++;
    }
}

int main() {
    *(unsigned long*)0x4000000 = 0x403; // mode3, bg2 on
    int res = fatInitDefault();
    if (res) { //Success
        setWhite();
    } else { //Failure
        setRed();
    }
   
    FILE* pFile;
    char buffer[] = "test";
    pFile = fopen ( "myfile.bin" , "wb" );
    fwrite (buffer, 1, sizeof(buffer), pFile);
    fclose (pFile);
   
    while(1){}
}


When I get to step 3 in the tutorial, I get the following error while attempting to apply the DLDI patch to the resulting rom:
"(file) does not have a DLDI section"

I tried testing the program anyways, the screen turned red (indicates that libfat didn't initialize correctly).

Any ideas on what I'm doing wrong?
(And yes, I remembered to add -lfat to the LIBS section of my makefile)


Last edited by wallacoloo on Tue Sep 01, 2009 12:14 am; edited 1 time in total

#170095 - DiscoStew - Sun Aug 30, 2009 2:43 am

You haven't mentioned it, so I assume you haven't done it. Did you add "-lfat" to the LIBS line in your Makefile?
_________________
DS - It's all about DiscoStew

#170096 - wallacoloo - Sun Aug 30, 2009 5:26 am

Yes, I have the lib included. Maybe I should've mentioned that.
My libs section says this:

LIBS := -lfat -lgba

Now in their example, they had this:

LIBS := -lfat -lnds9

I figure that since I'm developing for the GBA, I didn't need to include libnds.

#170289 - wallacoloo - Wed Sep 16, 2009 1:53 am

Hmm, I really don't know why this solution worked, but I solved it.

I compiled it as a multiboot rom. Anybody know why that made a difference?