| View previous topic :: View next topic |
| Author |
Message |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Wed Sep 26, 2007 9:05 am Post subject: having truoble with errors compiling |
|
|
Heres my code:
| Code: | | Code was redone and error free |
Heres my make file:
| Code: |
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 |
|
| Back to top |
|
 |
saulotmalo2
Joined: 10 Sep 2007 Posts: 43
|
Posted: Wed Sep 26, 2007 10:39 am Post subject: |
|
|
it looks like python ;)
| Code: | | if sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0 |
i'm not sure but try this:
| Code: | | if (sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0) |
|
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Wed Sep 26, 2007 10:43 am Post subject: |
|
|
hmmm,It's C++ lol xD
**edit**
I tried it but still. |
|
| Back to top |
|
 |
saulotmalo2
Joined: 10 Sep 2007 Posts: 43
|
Posted: Wed Sep 26, 2007 10:57 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Wed Sep 26, 2007 11:29 am Post subject: |
|
|
Well, i found a solution for the first error but created another one xD
fixed this
| Code: |
if sceIoGetstat("ms0:/PSP/GAME150/underdev/text.txt",io_stat_t) = 0 |
to this
| Code: | 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. >_< |
|
| Back to top |
|
 |
Chrighton
Joined: 15 Jun 2005 Posts: 58
|
Posted: Wed Sep 26, 2007 12:05 pm Post subject: |
|
|
Don't know about your io_stat_t problem, but your if statements are not right. Should be something like:
| Code: |
if(read == 0)
{
blah;
}
|
|
|
| Back to top |
|
 |
saulotmalo2
Joined: 10 Sep 2007 Posts: 43
|
Posted: Wed Sep 26, 2007 12:26 pm Post subject: |
|
|
| saulotmalo2 wrote: | it looks like python ;)
| Code: | | if sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) = 0 |
i'm not sure but try this:
| Code: | | 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: | | if (sceIoGetstat("ms0:/PSP/GAME150/underdev/pass.txt",io_stat_t) == 0) | [/quote]
By coping your code I have forgot the other = |
|
| Back to top |
|
 |
Smong
Joined: 04 Sep 2007 Posts: 82
|
Posted: Thu Sep 27, 2007 1:13 am Post subject: |
|
|
| Code: | 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. _________________ (+[__]%) |
|
| Back to top |
|
 |
Tinnus
Joined: 29 Jul 2006 Posts: 67
|
Posted: Thu Sep 27, 2007 10:50 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
AntiBNI
Joined: 24 Sep 2007 Posts: 15 Location: Planet Earth
|
Posted: Thu Sep 27, 2007 12:10 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
saulotmalo2
Joined: 10 Sep 2007 Posts: 43
|
Posted: Thu Sep 27, 2007 12:24 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Sep 27, 2007 12:56 pm Post subject: |
|
|
| There is no graphics lib with the pspsdk. Whatever that is, it has nothing to do with the psp. :) |
|
| Back to top |
|
 |
|