Jump to content
  • 0

pc.c(5945): warning C4013: 'pow' undefined; assuming extern returning int


Legato

Question


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

Hey, everyone. Title says it all. Can somebody tell me why I am getting that warning?

I found BUILDIN_FUNC(pow) on script.c and couldn't find any more. Or perhaps, I wasn't search hard enough.

Can someone explain me, what does it mean, the warning. Thank you. Any help would be greatly appreciated.

Happy Holidays!

Regards,

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

I think that function pow is not declared and it being used in other functions so thats why it is reporting a warning. I guess that 5945 is the line number in pc.c where it is being used.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Is this an issue with the latest rAthena version (from the SVN) ?

or do you have some custom edits to /src/map/script.c that caused this?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

I think its not Im not getting this error also. And I found also that function in script.c. I also noticed its a Math function. maybe just try adding them.

find

BUILDIN_FUNC(sqrt)

add below the function heres the code

BUILDIN_FUNC(pow)
{
double i, a, b;
a = script_getnum(st,2);
b = script_getnum(st,3);
i = pow(a,;
script_pushint(st,(int)i);
return 0;
}


Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

just put #include <math.h> and that should fix it. It should compile with -lm option by default anyway.

Oops this anwser is based on your title error message, if you wan't the script function then yes add JayPeeMateo snipet.

Edited by Lighta
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  633
  • Reputation:   78
  • Joined:  11/14/11
  • Last Seen:  

@Lighta

thats not my snippet I just copied it from rAthenas SVN coz he said

I found BUILDIN_FUNC(pow) on script.c and couldn't find any more. Or perhaps, I wasn't search hard enough.

Edited by JayPeeMateo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

@BrianL

No, sir. It's not from rAthena's svn. I found a .patch file when I was browsing the eAthena's forum. It's a custom, yes.

But, I am using rAthena's svn.

@JayPeeMateo

I have that on script.c.

@Lighta

Sure. Thanks, would try that.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

The pow script command is already in our SVN.

You don't need to do any additional edits, just checkout a clean copy from the SVN, compile, and it should work. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...