#148985 - zajako - Sun Jan 13, 2008 4:34 am
Here is the error I get when trying to make the hello world app:
Code: |
C:\devkitPro\examples\nds\Graphics\2D\hello_world>make
linking hello_world.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/th
umb/ds_arm9_crt0.o: In function `CIDLoop':
ds_arm9_crt0.s:(.init+0x2ac): undefined reference to `initSystem'
collect2: ld returned 1 exit status
make[1]: *** [/c/devkitPro/examples/nds/Graphics/2D/hello_world/hello_world.elf]
Error 1
make: *** [build] Error 2
|
I installed obviously devkitpro, and PALib.
Any help would be greatly appreciated.
#148986 - Dwedit - Sun Jan 13, 2008 5:33 am
Try using MSYS bash instead of cmd.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#148987 - zajako - Sun Jan 13, 2008 5:46 am
Sorry to be a noob (which to this stuff, I am) But when i went to download MSYS, there are tons of packages and downloads, and I have very little to no idea which to download :/
http://sourceforge.net/project/showfiles.php?group_id=2435
That shows all the files for it, but i'm not sure which of the files I should be getting.
#148989 - tepples - Sun Jan 13, 2008 5:50 am
The easiest way to get MSYS is probably through devkitPro Updater itself.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#148990 - zajako - Sun Jan 13, 2008 5:55 am
oh, then I already have it.
Code: |
Zajako@SANTA /home/zajako/hello_world
$ make
linking hello_world.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/th
umb/ds_arm9_crt0.o: In function `CIDLoop':
ds_arm9_crt0.s:(.init+0x2ac): undefined reference to `initSystem'
collect2: ld returned 1 exit status
make[1]: *** [/home/zajako/hello_world/hello_world.elf] Error 1
make: *** [build] Error 2 |
Still get this error.
#148991 - chishm - Sun Jan 13, 2008 7:01 am
You're using DKA r21 crt0 but haven't linked in the correct libnds. Either link in the correct libnds or write a void initSystem (void) function.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com
#148994 - zajako - Sun Jan 13, 2008 7:42 am
>.< I'm a noob :/ sorry, I don't know how to do either of those things, but all the examples for devkitPro produce that or similar errors.
I'm a pro php programmer, just new to C, and heard working with homebrew DS is a good way to learn.
EDIT
I put
Code: |
void initSystem() {
//---------------------------------------------------------------------------------
} |
In above the main function, and i get this error still:
Code: |
$ make
main.cpp
arm-eabi-g++ -MMD -MP -MF /home/zajako/hello_world/build/main.d -g -Wall -O2 -mc
pu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-int
erwork -I/home/zajako/hello_world/include -I/home/zajako/hello_world/build -I/c/
devkitPro/libnds/include -I/c/devkitPro/libnds/include -I/home/zajako/hello_worl
d/build -DARM9 -fno-rtti -fno-exceptions -c /home/zajako/hello_world/source/main
.cpp -o main.o
linking hello_world.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.2/../../../../arm-eabi/lib/th
umb/ds_arm9_crt0.o: In function `CIDLoop':
ds_arm9_crt0.s:(.init+0x2ac): undefined reference to `initSystem'
collect2: ld returned 1 exit status
make[1]: *** [/home/zajako/hello_world/hello_world.elf] Error 1
make: *** [build] Error 2 |
#148998 - Cearn - Sun Jan 13, 2008 12:13 pm
The `cpp' extension means you're actually compiling as C++ instead of C. This usually doesn't matter that much as far as function calls are concerned, except that C++ uses Name mangling to allow things as function overloading. This means that a C++ function called initSystem isn't actually called initSystem internally, but rather something like _Z10initSystemv. Since assembly and regular C don't do this name mangling, they're looking for the wrong function name.
To fix, either put the function in a separate .c file, or put extern "C" in front of the name. In the long run, it might be better to replace PALib's libnds by an updated libnds, but I'm not sure if you can simply replace the whole directory. I think the main thing is that the headers (the `include' directory) and lib/libnds9.a are updated, but I may be wrong there.
#149003 - zajako - Sun Jan 13, 2008 1:15 pm
I fixed it, by uninstalling it all, and just not installing PALib. So it was a problem with PALib's libnds.