SA-MP Forums Archive
Undefined symbol - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Undefined symbol (/showthread.php?tid=278239)



Undefined symbol - KoczkaHUN - 21.08.2011

I am trying to make a hook of SetPlayerPos, but there is a problem:
pawn Code:
#if !defined SetPlayerPos
#error "WTF?"
#endif
#undef SetPlayerPos // line 71
compile:
Quote:

C:\blah_blah.blah(71) : error 017: undefined symbol "SetPlayerPos"
C:\blah_blah.blah(71) : error 010: invalid function or declaration

What am I doing wrong?


Re: Undefined symbol - Pinguinn - 21.08.2011

SetPlayerPos is already in samp.inc? ...


Re: Undefined symbol - KoczkaHUN - 21.08.2011

SetPlayerPos is in a_players.inc and that is in a_samp.inc but this is why i've added that check.
If it wouldn't be defined, it would say "user error: WTF?"


Re: Undefined symbol - sleepysnowflake - 21.08.2011

Well, you undefined it. You have to define it back before using it ?


Re: Undefined symbol - KoczkaHUN - 21.08.2011

but I can't undefine it. on the undef line, the compiler gives an error and that's what I don't get.


Re: Undefined symbol - KoczkaHUN - 21.08.2011

The same if I do
pawn Code:
#if defined SetPlayerPos
#undef SetPlayerPos
#endif



Re: Undefined symbol - PhoenixB - 21.08.2011

Get rid of
#if defined SetPlayerPos
#undef SetPlayerPos

Then you can use it as it is already included in a_samp so you must have at the top of your script
#include <a_samp> // Its a requirement to include it.


Re: Undefined symbol - KoczkaHUN - 21.08.2011

>_< you did not caught what I meant.


Re: Undefined symbol - Basicz - 21.08.2011

Lol this is funny!
pawn Code:
#include    < a_samp > // SetPlayerPos is defined on a_players.inc, which it is included in a_samp

#if !defined SetPlayerPos // If it's not defined
    #error "ROFLMAO!!!" // Instruct the compiler to make an error.
#else // Else
    #undef SetPlayerPos // Undefine it, error in this line.
#endif
Or just :
pawn Code:
#include < a_samp >

#undef SetPlayerPos // Error, SetPlayerPos is not defined =)
Got the same error, didn't even used SetPlayerPos.

My brains got confused ...


AW: Undefined symbol - Nero_3D - 21.08.2011

You cant undefine a native, just READ THAT