SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/09/2011, 03:26 PM   #1
SA_Claude
Little Clucker
 
Join Date: Jul 2011
Location: HongKong
Posts: 24
Reputation: 0
Default symbol already defined: "strtok"

HTML Code:
strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
HTML Code:
D:\0.3c Server R5\gamemodes\SevenStar.pwn(68) : error 021: symbol already defined: "strtok"

HTML Code:
#include <a_samp>
#include "../include/gl_common.inc"

#include <sscanf>
#pragma tabsize 0
#include <float>
#include <dini>
#include <a_players>
#include <file>
#include <core>
HELP HELP HELP!!
SA_Claude is offline   Reply With Quote
Old 17/09/2011, 03:28 PM   #2
Mikkel_Pedersen
Big Clucker
 
Mikkel_Pedersen's Avatar
 
Join Date: Oct 2009
Posts: 149
Reputation: 20
Default Re: symbol already defined: "strtok"

strtok is already created inside gl_common.inc. So I guess if you just remove the strtok code in your script and recompile, then it should work without errors.
Mikkel_Pedersen is offline   Reply With Quote
Old 18/09/2011, 03:01 AM   #3
SA_Claude
Little Clucker
 
Join Date: Jul 2011
Location: HongKong
Posts: 24
Reputation: 0
Default Re: symbol already defined: "strtok"

Quote:
Originally Posted by Mikkel_Pedersen View Post
strtok is already created inside gl_common.inc. So I guess if you just remove the strtok code in your script and recompile, then it should work without errors.
But I need this strtok code
SA_Claude is offline   Reply With Quote
Old 18/09/2011, 03:36 AM   #4
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 2,629
Reputation: 410
Default Re: symbol already defined: "strtok"

Quote:
Originally Posted by SA_Claude View Post
But I need this strtok code
You do not need it twice. Either delete it from your code or gl_common.inc.
__________________
[HiC]TheKiller is offline   Reply With Quote
Old 18/09/2011, 05:48 AM   #5
AustinJ
Big Clucker
 
Join Date: Jul 2011
Posts: 145
Reputation: 15
Default Re: symbol already defined: "strtok"

Or... Don't use strtok and use a new way such as sscanf.
__________________
AustinJ is offline   Reply With Quote
Old 22/09/2011, 12:07 PM   #6
SA_Claude
Little Clucker
 
Join Date: Jul 2011
Location: HongKong
Posts: 24
Reputation: 0
Default Re: symbol already defined: "strtok"

ok thanks guys
SA_Claude is offline   Reply With Quote
Old 22/06/2016, 09:15 AM   #7
Samtwisting
Little Clucker
 
Samtwisting's Avatar
 
Join Date: Jun 2015
Location: Ghana,Kumasi
Posts: 8
Reputation: 0
Default Re: symbol already defined: "strtok"

how deleting the gl_common ? Am a noob help
__________________
Samtwisting is offline   Reply With Quote
Old 02/08/2020, 07:17 PM   #8
Barr
Little Clucker
 
Join Date: Jun 2017
Posts: 8
Reputation: 0
Default Re: symbol already defined: "strtok"

Quote:
Originally Posted by [HiC]TheKiller View Post
You do not need it twice. Either delete it from your code or gl_common.inc.
me salvou <3
Barr is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 021: symbol already defined: "strtok" afizie98 Help Archive 8 08/08/2011 02:04 PM
Need Help error 021: symbol already defined: "Streamer_OnPlayerConnect" Reeshan Help Archive 2 24/06/2011 04:52 PM
"error 021: symbol already defined" pawn bug? Luk_Ass Help Archive 4 11/07/2010 12:44 PM
one error (1045) : error 021: symbol already defined: "strtok" |CrippinBloodDrippin| Help Archive 12 26/12/2009 04:47 PM


All times are GMT. The time now is 03:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.