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 > Tutorial Example won't compile

#112710 - spectre1989 - Tue Dec 19, 2006 6:57 pm

Hey all,

I've been doing the tutorial manual on patatersoft.info, but I've been having some problems. I keep getting the error:

Quote:

c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp: In function 'void initSprites(SpriteEntry*, SpriteRotation*)':
c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:75: error: 'coordinate' was not declared in this scope
c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:75: error: expected `;' before 'position'
c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:76: error: 'position' was not declared in this scope
c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:82: error: 'ATTRO_COLOR_256' was not declared in this scope
c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:82: error: 'ATTRO_ROTSCALE_DOUBLE' was not declared in this scope


This is really starting to do my head in. Can anyone suggest a solution?

Cheers
-Spec

#112711 - tepples - Tue Dec 19, 2006 7:04 pm

Please paste the lines of code to which this error refers.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#112712 - spectre1989 - Tue Dec 19, 2006 7:08 pm

Sorry of course, this is the whole function, just so you can get an idea of what I'm trying to do aswell:

Quote:

void initSprites(SpriteEntry * spriteEntry, SpriteRotation * spriteRotation) {
//init OAM
initOAM(spriteEntry, spriteRotation);

coordinate position;
position.x = SCREEN_WIDTH/2 - 64;
position.y = SCREEN_HEIGHT/2 - 64;

//create the ship sprite
int orangeShipGfxID = 64;

spriteEntry[0].attribute[0] = ATTRO_COLOR_256 |
ATTRO_ROTSCALE_DOUBLE | //able to rotscale
(int)position.y;

spriteEntry[0].attribute[1] = ATTR1_ROTDATA(0) |
ATTR1_SIZE_64 | //size 64x64
(int)position.x;

spriteEntry[0].attribute[2] = orangeShipGfxID;

//set initial rotation attributes
rotateSprite(&spriteRotation[0], 0);

//copy in the sprite palettes
dmaCopy(OrangeShuttlePalette_bin, //from address
(uint16 *)SPRITE_PALETTE, //to address
OrangeShuttlePalette_bin_size); //size of data to copy

//update the OAM
updateOAM(spriteEntry);
}


Last edited by spectre1989 on Tue Dec 19, 2006 7:13 pm; edited 1 time in total

#112713 - tepples - Tue Dec 19, 2006 7:10 pm

spectre1989 wrote:
Sorry of course, this is the whole function, just so you can get an idea of what I'm trying to do aswell:

Quote:

void initSprites(SpriteEntry * spriteEntry, SpriteRotation * spriteRotation) {
//init OAM
initOAM(spriteEntry, spriteRotation);

coordinate position;

Which header file defines the data type "coordinate"?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#112715 - spectre1989 - Tue Dec 19, 2006 7:17 pm

I have no idea, its in this tutorial, the headers used are as follows:

Quote:

#include <nds.h>

//gfx
#include "StarField_bin.h"
#include "Splash_bin.h"
#include "OrangeShuttle_bin.h"
#include "OrangeShuttlePalette_bin.h"
#include "Sprites.h"
#include "Sprites.cpp"


I know it isn't defined in any of those under gfx, so it must be in nds.h, though considering that it.. well.. isn't.. Then maybe its a mistake in the tutorial? I tried defining the class in main.cpp with integers x and y as public member variables, but I was still left with the errors:

Quote:

c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:82: error: 'ATTRO_COLOR_256' was not declared in this scope
c:/DS/SourceCode/orange_spaceship_tut/source/main.cpp:82: error: 'ATTRO_ROTSCALE_DOUBLE' was not declared in this scope


(Obviously the line numbers are slightly different due to the extra class defining code, but the error itself is exactly the same)

#112718 - spectre1989 - Tue Dec 19, 2006 8:18 pm

Oh and just incase in makes a difference, I'm running Windows xp pro

#112723 - Sausage Boy - Tue Dec 19, 2006 9:08 pm

Do you get any more errors than that?
_________________
"no offense, but this is the gayest game ever"

#112724 - spectre1989 - Tue Dec 19, 2006 9:21 pm

Ah I just figured it out. I was writing ATTRO instead of ATTR0. Silly me.

However I'm now getting this error.. What the hell does it mean?

Quote:

> "make"
linking orange_spaceship_tut.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: ERROR: Source object c:/devkitPro/libnds/lib\libnds9.a(COS.o) has EABI version 0, but target c:/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf has EABI version 4
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/libnds/lib\libnds9.a(COS.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: ERROR: Source object c:/devkitPro/libnds/lib\libnds9.a(SIN.o) has EABI version 0, but target c:/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf has EABI version 4
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/libnds/lib\libnds9.a(SIN.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: ERROR: Source object c:/devkitPro/libnds/lib\libnds9.a(video.o) has EABI version 0, but target c:/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf has EABI version 4
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/libnds/lib\libnds9.a(video.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: ERROR: Source object c:/devkitPro/libnds/lib\libnds9.a(interrupts.o) has EABI version 0, but target c:/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf has EABI version 4
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/libnds/lib\libnds9.a(interrupts.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: ERROR: Source object c:/devkitPro/libnds/lib\libnds9.a(cache.o) has EABI version 0, but target c:/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf has EABI version 4
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/libnds/lib\libnds9.a(cache.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: ERROR: Source object c:/devkitPro/libnds/lib\libnds9.a(interruptDispatcher.o) has EABI version 0, but target c:/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf has EABI version 4
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.1.1/../../../../arm-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/libnds/lib\libnds9.a(interruptDispatcher.o)
collect2: ld returned 1 exit status
make[1]: *** [/c/DS/SourceCode/orange_spaceship_tut/orange_spaceship_tut.elf] Error 1
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:00

_________________
Pro-test: Standing up for science, standing up for what's right

#112728 - OOPMan - Tue Dec 19, 2006 10:51 pm

Maybe you should try uninstalling devkitPro and reinstalling it from scratch...

It looks like you have some weird version conflicts...

Did you try to upgrade from an older devkitPro release?
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#112735 - tepples - Tue Dec 19, 2006 11:18 pm

If you upgraded, and you recompile, you may still have .o or .a files that you compiled with R18 or earlier. You'll need to recompile them.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#112754 - wintermute - Wed Dec 20, 2006 12:27 am

You've updated devkitARM but not libnds.

The best way to deal with it is just to use the web installer.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#112761 - spectre1989 - Wed Dec 20, 2006 1:21 am

Cheers for that, I tried manually updating libnds earlier and mustve accidentally downloaded outdated files. Thanks for the help chaps, its now running smoothly :)
_________________
Pro-test: Standing up for science, standing up for what's right