forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

having truoble with errors compiling

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Wed Sep 26, 2007 9:05 am    Post subject: having truoble with errors compiling Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
saulotmalo2



Joined: 10 Sep 2007
Posts: 43

PostPosted: Wed Sep 26, 2007 10:39 am    Post subject: Reply with quote

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
View user's profile Send private message
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Wed Sep 26, 2007 10:43 am    Post subject: Reply with quote

hmmm,It's C++ lol xD

**edit**
I tried it but still.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
saulotmalo2



Joined: 10 Sep 2007
Posts: 43

PostPosted: Wed Sep 26, 2007 10:57 am    Post subject: Reply with quote

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
View user's profile Send private message
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Wed Sep 26, 2007 11:29 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Chrighton



Joined: 15 Jun 2005
Posts: 58

PostPosted: Wed Sep 26, 2007 12:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
saulotmalo2



Joined: 10 Sep 2007
Posts: 43

PostPosted: Wed Sep 26, 2007 12:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Thu Sep 27, 2007 1:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Tinnus



Joined: 29 Jul 2006
Posts: 67

PostPosted: Thu Sep 27, 2007 10:50 am    Post subject: Reply with quote

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
View user's profile Send private message
AntiBNI



Joined: 24 Sep 2007
Posts: 15
Location: Planet Earth

PostPosted: Thu Sep 27, 2007 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
saulotmalo2



Joined: 10 Sep 2007
Posts: 43

PostPosted: Thu Sep 27, 2007 12:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Sep 27, 2007 12:56 pm    Post subject: Reply with quote

There is no graphics lib with the pspsdk. Whatever that is, it has nothing to do with the psp. :)
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group