having truoble with errors compiling

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

having truoble with errors compiling

Post by AntiBNI »

Heres my code:

Code: Select all

Code was redone and error free
Heres my make file:

Code: Select all

TARGET = hello
OBJS = main.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpsppower -lpspctrl -lgraphics
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = underdev

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
and here are the Errors:

expected '<' before sceIoGetStat

at global scope:

expected constructor , destructor or type conversion before ';' token
expected declaration before '>' token

Thanks to who ever helps ^_^
Last edited by AntiBNI on Thu Sep 27, 2007 12:12 pm, edited 1 time in total.
saulotmalo2
Posts: 43
Joined: Mon Sep 10, 2007 9:32 am

Post by saulotmalo2 »

it looks like python ;)

Code: Select all

if sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/pass.txt",io_stat_t&#41; = 0
i'm not sure but try this:

Code: Select all

if &#40;sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/pass.txt",io_stat_t&#41; = 0&#41;
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

hmmm,It's C++ lol xD

**edit**
I tried it but still.
saulotmalo2
Posts: 43
Joined: Mon Sep 10, 2007 9:32 am

Post by saulotmalo2 »

this isn't C++ xD this is C because I can't se the Orientation to Object.

Well I think you're are forgoting some ; or ( ) but the code is not clean so it is very hard to see try looking for some errors like the one before, as far as I know in C/C++ a conditional expresion always uses ( ). Try looking for bad writed things.
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

Well, i found a solution for the first error but created another one xD

fixed this

Code: Select all

if sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/text.txt",io_stat_t&#41; = 0 
to this

Code: Select all

char read = sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/text.txt",io_stat_t&#41;;
if &#40;read&#41; = 0
&#123;

&#125;
but now im getting this error:

io_stat_t was not declared in this scope.

lol,kill an error another pops from no ware. >_<
Chrighton
Posts: 58
Joined: Wed Jun 15, 2005 8:24 pm

Post by Chrighton »

Don't know about your io_stat_t problem, but your if statements are not right. Should be something like:

Code: Select all

if&#40;read == 0&#41;
&#123;
blah;
&#125;
saulotmalo2
Posts: 43
Joined: Mon Sep 10, 2007 9:32 am

Post by saulotmalo2 »

saulotmalo2 wrote:it looks like python ;)

Code: Select all

if sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/pass.txt",io_stat_t&#41; = 0
i'm not sure but try this:

Code: Select all

if &#40;sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/pass.txt",io_stat_t&#41; = 0&#41;
It must be because here is the 4:00 AM but I'm a bit stupid this should work:

Code: Select all

if &#40;sceIoGetstat&#40;"ms0&#58;/PSP/GAME150/underdev/pass.txt",io_stat_t&#41; == 0&#41;
[/quote]

By coping your code I have forgot the other =
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

Code: Select all

         if sceIoRead&#40;file,"&#40;X&#41;\r\n",7&#41; != &#40;X&#41;
         &#123;
            pspDebugScreenClear&#40;&#41;;
            pspDebugScreenSetXY&#40;34,17&#41;;
            printf&#40;"Wrong Combo!"&#41;;
            goto start;
         &#125; 
If you want to compare strings in C/C++ you should use strncmp (or one of the other strcmp functions). Since strings are pointers to an array of characters attempting to use == and != on them will only check the pointers themselves, not the values.

I also suggest avoiding the sceIo functions and instead use C library equivalents such as fopen, fgets and fclose. fgets will read in 1 line of text. If you use sceIoRead you need to do your own buffering to figure out where the end of each line is, which is unecessarily complex.
(+[__]%)
Tinnus
Posts: 67
Joined: Sat Jul 29, 2006 1:12 am

Post by Tinnus »

And don't use goto, that's bad! Unless you REALLY know what you're doing, and that's clearly not the case. (no offense!)

I suggest you take some basic C tutorials on if, for, while, switch, strings and stuff before trying to program for the PSP. It's going to make your experience a lot easier.
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
AntiBNI
Posts: 15
Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth

Post by AntiBNI »

Well, i re-did all my code and i'm now error free.

but now i have another problem,god they never go away >_<!

cgwin tells me

cannot find -lgraphics in usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/bin

where the hell is that directory,i have searched and searched but i cant find it.
saulotmalo2
Posts: 43
Joined: Mon Sep 10, 2007 9:32 am

Post by saulotmalo2 »

usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/bin
is the same that

usr/local/pspdev/psp/bin

and also I bet that the error says that is this directory usr/local/pspdev/psp/lib

and here you have to look for libgraphics.a or something like that.

also... are you sure about that you need the graphics library? if you don't need that just erase it from your make file
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

There is no graphics lib with the pspsdk. Whatever that is, it has nothing to do with the psp. :)
Post Reply