Hi,
I am working on Windows XP with root 5.16. I would like to use a CRITICAL_SECTION in a class and cant get it to compile with rootcint. I realize CRITICAL_SECTION is a typedef which eventually ends up in winnt.h
typedef struct _RTL_CRITICAL_SECTION {
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
//
// The following three fields control entering and exiting the critical
// section for the resource
//
LONG LockCount;
LONG RecursionCount;
HANDLE OwningThread; // from the thread's ClientId->UniqueThread
HANDLE LockSemaphore;
ULONG_PTR SpinCount; // force size on 64-bit systems when packed
} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
I am not sure how I should modify my Linkdef.h to make my Worker class compile.
My Linkdef.h file is
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class Worker;
#endif
// -- Worker.h
#ifndef SAW_CORRELATION_WORKER
#define SAW_CORRELATION_WORKER
#include <windows.h>
class Worker
{
public:
// Construction
Worker() {};
virtual ~Worker() {}
// Operations
static void act();
private:
// Data
CRITICAL_SECTION m_criticalSection;
};
#endif
// --Worker.cpp
#include "Worker.h"
#include <iostream>
void
Worker::act()
{
std::cout << "I am here\n";
}
At present when I run I get:
C:\QVCS\dev\root\work\utils\test1>rootcint -f WorkerDict.cxx -c -p Worker.h Link
Def.h
2102415_cint.cxx
Error: Symbol CRITICAL_SECTIONm_criticalSection is not defined in current scope
.\worker.h(19)
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing WorkerDict.cxx WorkerDict.h !!!
Error: rootcint: error loading headers...
C:\QVCS\dev\root\work\utils\test1>
Thanks,
Sanjeev
Worker.cpp (136 Bytes)
Worker.h (326 Bytes)
LinkDef.h (163 Bytes)