Discuss the development of new homebrew software, tools and libraries.
Moderators: cheriff , TyRaNiD
AntiBNI
Posts: 15 Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth
Post
by AntiBNI » Wed Sep 26, 2007 9:05 am
Heres my code:
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 » Wed Sep 26, 2007 10:39 am
it looks like python ;)
Code: Select all
if sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0
i'm not sure but try this:
Code: Select all
if (sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0)
AntiBNI
Posts: 15 Joined: Mon Sep 24, 2007 1:15 pm
Location: Planet Earth
Post
by AntiBNI » Wed Sep 26, 2007 10:43 am
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 » Wed Sep 26, 2007 10:57 am
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 » Wed Sep 26, 2007 11:29 am
Well, i found a solution for the first error but created another one xD
fixed this
Code: Select all
if sceIoGetstat("ms0:/PSP/GAME150/underdev/text.txt",io_stat_t) = 0
to this
Code: Select all
char read = sceIoGetstat("ms0:/PSP/GAME150/underdev/text.txt",io_stat_t);
if (read) = 0
{
}
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 » Wed Sep 26, 2007 12:05 pm
Don't know about your io_stat_t problem, but your if statements are not right. Should be something like:
Code: Select all
if(read == 0)
{
blah;
}
saulotmalo2
Posts: 43 Joined: Mon Sep 10, 2007 9:32 am
Post
by saulotmalo2 » Wed Sep 26, 2007 12:26 pm
saulotmalo2 wrote: it looks like python ;)
Code: Select all
if sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0
i'm not sure but try this:
Code: Select all
if (sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0)
It must be because here is the 4:00 AM but I'm a bit stupid this should work:
Code: Select all
if (sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) == 0)
[/quote]
By coping your code I have forgot the other =
Smong
Posts: 82 Joined: Tue Sep 04, 2007 4:44 am
Post
by Smong » Thu Sep 27, 2007 1:13 am
Code: Select all
if sceIoRead(file,"(X)\r\n",7) != (X)
{
pspDebugScreenClear();
pspDebugScreenSetXY(34,17);
printf("Wrong Combo!");
goto start;
}
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 » Thu Sep 27, 2007 10:50 am
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 » Thu Sep 27, 2007 12:10 pm
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 » Thu Sep 27, 2007 12:24 pm
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. » Thu Sep 27, 2007 12:56 pm
There is no graphics lib with the pspsdk. Whatever that is, it has nothing to do with the psp. :)