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 

Can't use a function more than once

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



Joined: 09 Aug 2007
Posts: 8

PostPosted: Thu Aug 09, 2007 6:21 pm    Post subject: Can't use a function more than once Reply with quote

Hi all,

I am new to the forum and have just started development for the PSP. I am using devkitpro to develop for the PSP.
I have created a function and if I call that function more than once, when trying to compile I get the error:

.ent or .aent not in text section
.end not in text section
operation combines symbols in different segments

an example of a function is:

int testF(int val)
{
return val*2;
}

if I call the above function such as:

int tval=testF();

it works but if I call it twice:

int tval=testF();
int tval2=testF();

and the code doesn't compile.

Sorry if the answer exists already, I tried searching but didn't find anything.
Back to top
View user's profile Send private message
rapso



Joined: 28 Mar 2005
Posts: 147

PostPosted: Thu Aug 09, 2007 6:25 pm    Post subject: Reply with quote

could you post the output here? and maybe the whole source+make
Back to top
View user's profile Send private message
Slash



Joined: 07 Jan 2007
Posts: 26

PostPosted: Thu Aug 09, 2007 6:30 pm    Post subject: Re: Can't use a function more than once Reply with quote

yimtaka wrote:
Hi all,

I am new to the forum and have just started development for the PSP. I am using devkitpro to develop for the PSP.
I have created a function and if I call that function more than once, when trying to compile I get the error:

.ent or .aent not in text section
.end not in text section
operation combines symbols in different segments

an example of a function is:

int testF(int val)
{
return val*2;
}

if I call the above function such as:

int tval=testF();

it works but if I call it twice:

int tval=testF();
int tval2=testF();

and the code doesn't compile.

Sorry if the answer exists already, I tried searching but didn't find anything.


Your function requires an int value. So you have to change it from:

Quote:
int tval=testF();
int tval2=testF();


to...

Quote:
int tval=testF(x);
int tval2=testF(x);


where X is a number.
Back to top
View user's profile Send private message
yimtaka



Joined: 09 Aug 2007
Posts: 8

PostPosted: Thu Aug 09, 2007 6:30 pm    Post subject: Reply with quote

Sorry I can't at the moment as I am at work. I used the sample from the SDK folder called ortho in the GU folder. I just added a function to it.
Could I be missing something in the make file?
Back to top
View user's profile Send private message
yimtaka



Joined: 09 Aug 2007
Posts: 8

PostPosted: Thu Aug 09, 2007 6:31 pm    Post subject: Re: Can't use a function more than once Reply with quote

Slash wrote:
yimtaka wrote:
Hi all,

I am new to the forum and have just started development for the PSP. I am using devkitpro to develop for the PSP.
I have created a function and if I call that function more than once, when trying to compile I get the error:

.ent or .aent not in text section
.end not in text section
operation combines symbols in different segments

an example of a function is:

int testF(int val)
{
return val*2;
}

if I call the above function such as:

int tval=testF();

it works but if I call it twice:

int tval=testF();
int tval2=testF();

and the code doesn't compile.

Sorry if the answer exists already, I tried searching but didn't find anything.


Your function requires an int value. So you have to change it from:

Quote:
int tval=testF();
int tval2=testF();


to...

Quote:
int tval=testF(x);
int tval2=testF(x);


where X is a number.



yes you're right, it's my mistake typing the example but even that produces the same error.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Fri Aug 10, 2007 2:47 am    Post subject: Reply with quote

You'll have to post the full code and error output; you haven't given us enough information to answer.
Back to top
View user's profile Send private message
yimtaka



Joined: 09 Aug 2007
Posts: 8

PostPosted: Fri Aug 10, 2007 5:49 pm    Post subject: Reply with quote

it's working now!. I removed the -O2 parameter from the makefile and it compiles and works on my psp now. Sorry for the lack of information.
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sun Aug 12, 2007 12:40 am    Post subject: Reply with quote

I guess, its an alias optimization issue.
Back to top
View user's profile Send private message
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