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 > DS sprite isue

#165860 - GaryShea - Fri Jan 09, 2009 11:00 pm

http://pastebin.com/m17f40a16

Source for sprites.cpp, sprite.h

Error message

c:/devkitPro/template/source/sprites.cpp: In function 'void OAMTable(O
AMTable*)':
c:/devkitPro/template/source/sprites.cpp:10: error: 'void OAMTable(OAM
Table*)' redeclared as different kind of symbol
c:/devkitPro/libnds/include/nds/arm9/sprite.h:223: error: previous declaration o
f 'typedef union OAMTable OAMTable'
c:/devkitPro/template/source/sprites.cpp:14: error: 'ATTRO_DISABLED' w
as not declared in this scope
make[1]: *** [sprites.o] Error 1
make: *** [build] Error 2

using lbnds 1.3.1

#165864 - Dwedit - Sat Jan 10, 2009 2:32 am

You have a function named OAMTable. Don't name functions the same as types.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#165869 - GaryShea - Sat Jan 10, 2009 7:44 am

ok. what about the attro_dsiabled?

#165870 - DiscoStew - Sat Jan 10, 2009 8:05 am

It must be a zero in ATTR0_DISABLED, not the letter 'O'
_________________
DS - It's all about DiscoStew

#165871 - GaryShea - Sat Jan 10, 2009 8:09 am

ha, i see. Same thing pissed me of about endl :P

Dwedit, that didn't work

#165872 - DiscoStew - Sat Jan 10, 2009 8:21 am

If I'm correct, shouldn't the function name in your source file be initOAMTable, so it would match that name you have in the header file?

Dwedit is correct though, in that you can't name functions something that is already given to something else, like types.
_________________
DS - It's all about DiscoStew

#165873 - GaryShea - Sat Jan 10, 2009 9:13 am

Ah yeah, I completely forgot to add the ini. i must of forgot.

thanks, works completely. ive been trying to get it fixed for 3 days :)