Re: [ROOT] 1st go with threads

From: P.Dixon (p.dixon@qmul.ac.uk)
Date: Fri Jun 28 2002 - 17:02:15 MEST


>    SurfMainFrame::fExternTest should be a static class method and not a
> member function.
> 
Cheers... one step closer... however...

is there anything special I have to have in my linkdef file for a 
static member funtion?

I'm getting some compile messages I don't understand:

Compiling canvasgui.cxx ...
SurfMainFrame.o: In function `SurfMainFrame::fThreadTest(void)':
SurfMainFrame.o(.text+0x3133): undefined reference to 
`TThread::TThread(char const *, void (*)(void *), void *, 
TThread::EPriority)'
SurfMainFrameDict.o: In function `TBuffer & operator>><TThread>(TBuffer &, 
TThread *&)':
SurfMainFrameDict.o(.gnu.linkonce.t.__rs__H1Z7TThread_R7TBufferRPX01_R7TBuffer+0xd): 
undefined reference to `TThread type_info function'
collect2: ld returned 1 exit status
make: *** [canvasgui] Error 1

my linkdef is:

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class SurfMainFrame;
#pragma link C++ global gSurfMainFrame;
#endif


I've been trying to follow the examples from:

http://www-linux.gsi.de/~go4/HOWTOthreads/howtoframe.html

And now I have 

.h file:
static void fExternalTest(void *fTarg);
void fThreadTest(void);
TThread *fEthread;

.cxx file:
void SurfMainFrame::fExternalTest(void *fTarg){
  char fReadLineText[1000];  
  FILE* in = gSystem->OpenPipe("./run.sh", "r");
  while (!feof(in)){
    fgets(fReadLineText, 1000, in);
    printf(fReadLineText);
    //fScaleTextView->AddLine(fReadLineText);
  }
  fclose(in);
}

void SurfMainFrame::fThreadTest(void){
     fEthread = new TThread("t1", &SurfMainFrame::fExternalTest, (void *)"0");
     //    fEthread->Run();
}

Cheers,
					Paul



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:58 MET