Raised This Month: $51 Target: $400
 12% 

Symbol already defined: ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hyper Nova
BANNED
Join Date: May 2012
Old 06-28-2012 , 19:20   Symbol already defined: ...
Reply With Quote #1

Hello Allied Modders!


I have problem again..

I do scripting now in pawn just like in c++ and java usually do
There are main file
something.sma
inside of it

PHP Code:
#include "smn/smn.smn"
#include "smn/smn.smn"
#include "smn/smn.smn"
...
#include "smn/smn.smn"
#include "smn/register_smn.smn"
#include "smn/something_smn.smn"
#include "smn/something2_smn.smn" 
and there are folder smn " smn means like something what i just dont want to write here "
inside the folders are files *.smn
the are like parts of big script
example in c++/c there are .cpp and h.
and the big script will be .dll
in pawn big script is .amxx then
( Edit: thats how the game engines work )

Now inside register_smd.smn i will show the problem part code
PHP Code:

public something()
{
    
do_something()


in something_smn.smn
PHP Code:
do_something()
{



in something_smn2.smn
PHP Code:
do_something()
{

and if i compile script it will say
Symbol already defined: do_something()
so my question is how to fix this.
how to do it that compiler will compile and things will work in game well.
its really to big work to rename this do_something() to every scripts.
I mean there must be a easy way to do this without doing things manually.
I already use this here:
PHP Code:
#if defined _myinc_included 
  #endinput 
#endif 
#define _myinc_included 
this solved that ( variable already defined ) problems.
Thank you in advance!

Last edited by Hyper Nova; 06-28-2012 at 19:24.
Hyper Nova is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-28-2012 , 22:18   Re: Symbol already defined: ...
Reply With Quote #2

Quote:
Originally Posted by Hyper Nova View Post
and there are folder smn " smn means like something what i just dont want to write here "
lol. Some people are just way too over protective of code that doesn't really matter if it's shown publicly.

I'm glad you solved your problem though. Good Job!
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-29-2012 , 01:25   Re: Symbol already defined: ...
Reply With Quote #3

In pawn, include file is just like putting all 1 single file before compilation.
So if you have more than 1 time the same function name it can't compile.
That is as simple, don't put 2 functions with the same name.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 13:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode