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 > Updated to r20

#123251 - Rajveer - Mon Mar 26, 2007 4:29 pm

Hi guys. I was using the devkitARM release from last July with PALib from around the same time. I uninstalled both, upgraded to devkitARM r20 (and installed the latest PALib ontop of that) and now my code won't compile. I can't check what the error is as command prompt prints out so many errors (most of them being like struct <anonymous> has no member named blahblahblah, 'f32' undeclared, expected ; infront of blahblahblah which are infact all ok). Maybe the way to include libnds has changed or something? This is what I'm doing at the moment:

Code:
#include <nds.h>
#include <PA9.h>
...
#include "math.h"
#include <stdlib.h>

#123252 - Lick - Mon Mar 26, 2007 4:45 pm

You are more likely to get an answer at the PAlib forum.
_________________
http://licklick.wordpress.com

#123254 - Rajveer - Mon Mar 26, 2007 5:00 pm

I would but the problem still exists when I don't include or use PALib (as I'm only using it for one thing), and therefore only use libnds.

#123258 - josath - Mon Mar 26, 2007 5:16 pm

Look at the first 2 or 3 errors. Those are usually the culprits, and then they cause a chain-reaction.

#123260 - Rajveer - Mon Mar 26, 2007 5:27 pm

I wish I could, but I get so many errors that command prompt won't let me scroll up to see the beginning ones! Anyway for me to do this?

EDIT: Ok running make in programmers notepad gives me the complete list of errors. The first few errors are:

Code:

main.c
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:28: error: expected specifier-qualifier-list before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:41: error: expected specifier-qualifier-list before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:52: error: expected specifier-qualifier-list before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:74: error: expected specifier-qualifier-list before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:96: error: expected specifier-qualifier-list before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:106: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'camerapos'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:107: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cameralook'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:108: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cameraup'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:111: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'LevelScale'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:114: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'waypointBoundary'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:133: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:133: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:133: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:141: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:141: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:141: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:141: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:141: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:141: error: expected declaration specifiers or '...' before 'f32'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:142: error: expected ')' before '*' token
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:143: error: expected declaration specifiers or '...' before 'f32'
In file included from c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/main.c:164:
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h: In function 'buildOctree':
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h:4: error: 'f32' undeclared (first use in this function)
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h:4: error: (Each undeclared identifier is reported only once
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h:4: error: for each function it appears in.)
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h:4: error: expected ';' before 'maxx'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h:8: error: 'struct <anonymous>' has no member named 'vertex0'
c:/DSDevelopment/devkitPro/Raji/3Dtest/3dtest48/source/Functions/octreeFunctions.h:8: error: 'LevelScale' undeclared (first use in this function)


Then it just keeps going through the program saying this is undeclared, this struct has no member e.t.c.

#123265 - HyperHacker - Mon Mar 26, 2007 8:46 pm

FYI, g++ tends to have more intelligent error handling than gcc. It can be the difference between "expected ; after foo" and 200 pages of errors.

Anyway it sounds like f32 isn't defined, but without the code, I can't tell for sure what's wrong.
_________________
I'm a PSP hacker now, but I still <3 DS.

#123267 - dannyboy - Mon Mar 26, 2007 8:58 pm

The f32 type is no longer defined in libNDS, you have to define it yourself. It was defined in libnds\include\nds\jtypes.h so just put the following line in there(or somewhere else where things are globally defined):

typedef int f32; // 1.19.12 fixed point for matricies

#123268 - Rajveer - Mon Mar 26, 2007 9:03 pm

HyperHacker you're right, checking the code against the errors and I've realised that it's a problem with f32 type.

Dannyboy, thanks for the heads up. Compiling gives another warning now: "overflow in implicit constant coversion" when I'm using t16, has this been removed too??

P.S. Do you know why it was removed, when there's so many functions using the f32 type? (I know it doesn't matter since f32 is just a typedef for int anyways, but it helped to understand it I guess)

EDIT: that was my mistake, no problem with t16 sorry.

#123309 - wintermute - Tue Mar 27, 2007 5:26 am

dannyboy wrote:
The f32 type is no longer defined in libNDS, you have to define it yourself. It was defined in libnds\include\nds\jtypes.h so just put the following line in there(or somewhere else where things are globally defined):

typedef int f32; // 1.19.12 fixed point for matricies


If you're going to define it, do it in your own headers.

Do not edit libnds headers for your own nefarious purposes.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#123310 - wintermute - Tue Mar 27, 2007 5:29 am

Rajveer wrote:


P.S. Do you know why it was removed, when there's so many functions using the f32 type? (I know it doesn't matter since f32 is just a typedef for int anyways, but it helped to understand it I guess)



f32 and most of the other fixed point "types" were removed because they should never have been defined in the first place.

fixed is used in STL and causes problems with some C++ applications

f32 means a 32bit floating point number in most other places I've seen it used.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#123314 - tepples - Tue Mar 27, 2007 6:10 am

Anything wrong with "fix32"? I seem to remember the Allegro library's fixed-point package going through a mass renaming of e.g. fmul() to fixmul() around 4.0.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.