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.

C/C++ > undefined reference

#78898 - Dan2552 - Mon Apr 10, 2006 1:44 pm

Code:
c:/ham/gcc-arm/bin/arm-thumb-elf-ld.exe    -L c:/ham/gcc-arm/lib/gcc-lib/arm-thumb-elf/3.3.2/interwork -L c:/ham/gcc-arm/lib/gcc-lib/arm-thumb-elf/3.3.2 -L c:/ham/gcc-arm/arm-thumb-elf/lib/interwork -L c:/ham/gcc-arm/arm-thumb-elf/lib -L c:/ham/gcc-arm/lib  --script c:/ham/system/lnkscript-afm -o axeknote.elf crt0.o main.o   ./libgba/lib/libgba.a -lafm -lham -lm -lstdc++ -lsupc++ -lgcc -lc -lgcc
main.o(.text+0x8c): In function `main':
: undefined reference to `FAT_InitFiles'
main.o(.text+0x90): In function `main':
: undefined reference to `FAT_mkdir'
main.o(.text+0x9c): In function `main':
: undefined reference to `FAT_fputs'
main.o(.text+0xa4): In function `main':
: undefined reference to `FAT_FreeFiles'
make: *** [axeknote.elf] Error 1



I added this to my makefile:
Code:
CFLAGS += -I ./gba_nds_fat


and to my main.c:
Code:
#include "gba_nds_fat/gba_nds_fat.h"




All the help the text file gives is
Quote:
Insert #include "gba_nds_fat/gba_nds_fat.h" into your project where you need compact flash access. Make sure you compile the included code by adding the gba_nds_cf directory to your sources.

This driver requires libgba on GBA or libnds on an NDS.


it all compiles fine if i don't try and use any functions for the gba_nds_fat lib, not really helpful..

What exactly do I need to do to get the LIB to work? On the HAM forums I've been advised to use a pre-compiled fat lib, is there one?

#78901 - tepples - Mon Apr 10, 2006 1:54 pm

Some C source code files should have come with the library. Add them to your project.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#78909 - Dan2552 - Mon Apr 10, 2006 3:27 pm

do you mean add as in add with visualham, or do you mean include?

Here's all the problems I'm having doing this
http://forums.ngine.de/viewtopic.php?p=6085#6085

Cant someone just give an empty example project with the fat driver :(

#78931 - tepples - Mon Apr 10, 2006 6:05 pm

Dan2552 wrote:
do you mean add as in add with visualham

Yes. Have you ever used more than one .c file in a VisualHAM project?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#79081 - Dan2552 - Tue Apr 11, 2006 2:49 pm

I tried adding them beforehand, it just adds a big list of files to OFILES and makes loads of errors at compile (I think i posted in the thread i linked to)