i make a thread by something like this:

Code:
 RThread iThread;
TInt err = iThread.Create(
	 KThreadName,
         afunc,
         KStackSize,
         NULL,
         NULL
        );
It compuiles and no errors are returned


but when i put RThread iThread; into header, the errors occur like its forbidden to use it outside creation func.
So this is a reason that i cant then execute iThread.Resum(); from other func.



First i will show the code then i will tell you that i included a header in onther file and that causes the problem

thread header
Code:

#ifndef TMOBEYETH_H
#define TMOBEYETH_H

#include <e32def.h>
#include <e32base.h>	// For CActive, link against: euser.lib
#include <e32std.h>		// For RTimer, link against: euser.lib
#include "stringunit.h"



 const TInt KStackSize = 32000;

 RThread iThread;
 
 RThread * iThreadPtr;        
         
#endif

source
Code:
#include "TMobEyeTh.h"


 
 
 TInt  afunc(TAny *obj)
	 {
	 return 1;
	 }
 

 
 
 void LELO()
	 {
 
 _LIT(KThreadName, "MyFirstThread"); 

TInt err = iThread.Create(
	 KThreadName,
         afunc,
         KStackSize,
         NULL,
         NULL
        );

(*iThreadPtr) = iThread;

}

it compiles w/o errors

but when i add "#include "TMobEyeTh.h" - this header shown before (to other file like mysamplefile.cpp", compiler tells me that
mwldsym2.exe: Multiply defined symbol: class RThread iThread (?iThread@@3VRThread@@A) in
mwldsym2.exe: files TMobEyeTh.o, MobEyeContainer.o
mwldsym2.exe: Multiply defined symbol: class RThread * iThreadPtr (?iThreadPtr@@3PAVRThread@@A) in
mwldsym2.exe: files TMobEyeTh.o, MobEyeContainer.o


x_X