• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Incompatibility with the JunkBuster
#1
Hello it's me again, I asked about error 25 when placing a new include, well the fact is that after trying many things, I found out that the problem is that being the JunkBuster include throws these 2 errors.?



Code:
\pawno\include\3DTryg.inc(1846) : error 025: function heading differs from prototype

\pawno\include\3DTryg.inc(1846) : error 021: symbol already defined: "JBC_GetPlayerSpeed"



If I remove the JunkBuster it compiles perfectly.



Is there a solution for this problem? the include I am trying to install is the 3DTryg to add new functions. Sorry for the inconvenience and thanks in advance.
  Reply
#2
I can't magically look into your computer and see what the exact code is. Anyway,



"error 025: function heading differs from prototype"

This means that a public function's arguments doesn't match it's arguments when it was forwarded. Eg.

Code:
forward myPublicFunction(Foo);

public myPublicFunction(Foo, Bar)

{

    return;

}

That would throw that error, for example.



"error 021: symbol already defined: "JBC_GetPlayerSpeed""

JBC_GetPlayerSpeed is already defined.
  Reply
#3
(2020-11-12, 07:10 AM)Kwarde Wrote: I can't magically look into your computer and see what the exact code is. Anyway,



"error 025: function heading differs from prototype"

This means that a public function's arguments doesn't match it's arguments when it was forwarded. Eg.

Code:
forward myPublicFunction(Foo);

public myPublicFunction(Foo, Bar)

{

? ? return;

}

That would throw that error, for example.



"error 021: symbol already defined: "JBC_GetPlayerSpeed""

JBC_GetPlayerSpeed is already defined.



Sorry for not putting the code part, here it is.



Code:
Tryg3D::Function:: Float:GetPlayerSpeed(playerid){

new Float:x,Float:y,Float:z;

GetPlayerVelocity(playerid,x,y,z);

return floatmul(VectorSize(x,y,z),PLAYER_SPEED_MULTIPLIER);

}



So what would be the possible solution?



The problem is not really the code, it is that the include JunkBuster and the include 3DTryg cannot be in the same code because it throws the aforementioned errors. If you put them separately each one works well.



Edited: I already solved the problem by deleting the part of the 3DTryg include where it gave me an error, I think it was because that part was already defined in the JunkBuster include. Cheers
  Reply
#4
Quote:error 021: symbol already defined: "JBC_GetPlayerSpeed"
Quote:JBC_GetPlayerSpeed is already defined.
Quote:I think it was because that part was already defined in the JunkBuster include
What a good guess :P. That error means a symbol (eg. a function or variable) was already declared (created).

The "function heading differs from prototype" occured because they weren't declared in the same way in this case. This code would produce the same errors:
Code:
Foo(a)
{
    return a;
}

Foo(b)
{
    return b;
}

If you're using pawno and not vscode I suggest (strongly recommend) using vscode. You could've find out way earlier by opening your includes directory and searching for "JBC_GetPlayerSpeed".

Also make sure it's actually safe to remove it from that include. You should report that as an issue aswell (if it's on Github, submit an issue there).
  Reply
#5
(2020-11-12, 12:15 PM)Ryder Sixz Wrote:
(2020-11-12, 07:10 AM)Kwarde Wrote: I can't magically look into your computer and see what the exact code is. Anyway,

"error 025: function heading differs from prototype"
This means that a public function's arguments doesn't match it's arguments when it was forwarded. Eg.
Code:
forward myPublicFunction(Foo);
public myPublicFunction(Foo, Bar)
{
? ? return;
}
That would throw that error, for example.

"error 021: symbol already defined: "JBC_GetPlayerSpeed""
JBC_GetPlayerSpeed is already defined.

Sorry for not putting the code part, here it is.

Code:
Tryg3D::Function:: Float:GetPlayerSpeed(playerid){
new Float:x,Float:y,Float:z;
GetPlayerVelocity(playerid,x,y,z);
return floatmul(VectorSize(x,y,z),PLAYER_SPEED_MULTIPLIER);
}

So what would be the possible solution?

The problem is not really the code, it is that the include JunkBuster and the include 3DTryg cannot be in the same code because it throws the aforementioned errors. If you put them separately each one works well.

Edited: I already solved the problem by deleting the part of the 3DTryg include where it gave me an error, I think it was because that part was already defined in the JunkBuster include. Cheers
And what did I tell in the previous thread? :)
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#6
You gave me the idea bro c:
  Reply


Forum Jump: