Compiling error - 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)
+--- Thread: Compiling error (
/showthread.php?tid=626935)
Compiling error -
XBrianX - 22.01.2017
(1829) : error 025: function heading differs from prototype
(1830) : error 021: symbol already defined: "split"
LINE:
PHP код:
stock split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc))
{
if(strsrc[i] == delimiter || i == strlen(strsrc))
{
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
This only happens when i add
PHP код:
#include <mysql>
#define MYSQL_HOSTNAME "127.0.0.1"
#define MYSQL_DATABASE "fuckme"
#define MYSQL_USERNAME "root"
#define MYSQL_PASSWORD ""
Re: Compiling error -
StrikerZ - 22.01.2017
Try changing split to any other word
Re: Compiling error -
XBrianX - 22.01.2017
i disabled it and now it complies fine wtf
Re: Compiling error -
Sew_Sumi - 22.01.2017
Quote:
Originally Posted by XBrianX
i disabled it and now it complies fine wtf
|
Because obviously you either had it defined in your script a second time, or one of your includes already had it.
Re: Compiling error -
XBrianX - 22.01.2017
Quote:
Originally Posted by Sew_Sumi
Because obviously you either had it defined in your script a second time, or one of your includes already had it.
|
Yeah i guess but hey thanks
Re: Compiling error -
Crystallize - 22.01.2017
Sunehildeep already told you to rename it and it would've been fixed.
Re: Compiling error -
Sew_Sumi - 22.01.2017
Quote:
Originally Posted by Crystallize
Sunehildeep already told you to rename it and it would've been fixed.
|
Removing the define is the better option as otherwise you'll end up with 2 functions, doing exactly the same thing.
That is what the error was referring to in the first instance.