Problem using ROOTCINT

Hi!

I have a problem using ROOTCINT. I’m a C++ beginner (physics student) and my task is to develop an interface between ROOT and the ATLAS Pixel Detector Control System. I was glad to hear that there was a member of ATLAS DCS already assigned to that task. So I contacted him and downloaded his stuff including a PVSS manager (the software, DCS is based on) an a C++ project.

In principle it is a project to create a dll that should be accessible from root.

So as far as I understood it, everything I had to do (assuming, that the original code was working) was to add

#pragma link C++ class myClass;

to file linkdef.h,

a closing

ClassDef(myClass,0)

at the end of my class in my classes header file,

and an opening

ClassImp(myClass);

in my classes implementation file.

So far, so good. Yesterday I tried to use rootcint and it worked fine. A dictionary file was created and it used it to create the library. Afterwards I started root and tried my new classes methods. All fine.

Today I wanted to make a few changes. After that I tried to run rootcint again, this time receiving an error message. I downloaded the project again (assuming it was my fault). But the error was still there. I downloaded the latest version of ROOT and tried it again. No chance to kill the message:

"
rootcint -f PVSS.h PVSSGraph.h PVSSNames.h PVSSViews.h gamGlob.h stdafx.h linkdef.h > pvssdict.cxx

Limitation: Reference member not supported. Please use pointer
FILE:C:\root/include\TGenericClassInfo.h LINE:28
"

Needless to say, that there is nothing useful written in this file, at least for a beginner like me!

To say the truth, I have no idea, what is going on. I can’t remember having changed anything critical between yesterday and today. But I think, sometimes small things can be enough…

Is there anyone having an idea what such a strange message wants to tell me?
If so, please let me know!

Thanks in advance,

tobias

(ROOT version 4.08)

Hello Tobias,

Limitation: Reference member not supported. Please use pointer
FILE:C:\root/include\TGenericClassInfo.h LINE:28

It looks like this is a rootcint bug. This error should never occur
in rootcint. Will you send TGenericClassInfo.h to me by
e-mail (gotom@hanno.jp) What it claims is that there is a
reference member in a class and it is not supported by Cint.
There must be something like following code.
class A {
public:
int& x; // << this is the problem
};
If you can mask this with ‘#ifndef CINT’ , the error goes away anyway. But this is just a workaround.

class A {
public:
#ifndef CINT
int& x;
#endif
};

Thank you
Masa Goto

This is unlikely to be the command line you meant to write.  This generate a dictionary named PVSS.h (they usually should be ending in .C, .cxx or .cpp) and to treat the other header a C file (as opposed to C++).
You probably meant:
[code]rootcint -f PVSSDict.cxx -c PVSS.h PVSSGraph.h PVSSNames.h PVSSViews.h gamGlob.h stdafx.h linkdef.h [/code]
Also note that ClassDef is optional for class that do not inherit from TObject.
Also remember that if you want to use the I/O part of ROOT we recommend that you use
[code]#pragma link C++ class myClass+; [/code]
and __if__ you use a ClassDef use a class version greater than 0.

Cheers,
Philippe.

This is unlikely to be the command line you meant to write. This generate a dictionary named PVSS.h (they usually should be ending in .C, .cxx or .cpp) and to treat the other header a C file (as opposed to C++).
You probably meant:

Also note that ClassDef is optional for class that do not inherit from TObject.
Also remember that if you want to use the I/O part of ROOT we recommend that you use

and if you use a ClassDef use a class version greater than 0.

Cheers,
Philippe.

Hello again!

To ease the complexity of the project I used before, I tried to use rootcint with the simple example from the ROOT tutorial. I just copied the code there and used it as a new project. If I understood everything correct, the following code should be enough for a simple test:

[code]//file myClass.c:

#include <iostream.h>
#include “MyClass.h”

ClassImp(MyClass);

MyClass::MyClass()
{
fX = -1;
fY = -1;
}

void MyClass::Print() const
{
cout << "fX = " << fX << ", fY = " << fY << endl;
}
[/code]

this header file

[code]//file myClass.h:

#ifndef MyClass
#define MyClass

#include “Rtypes.h”

class MyClass {

private:
float fX; //x position in centimeters
float fY; //y position in centimeters

public:
MyClass();
void Print() const;
void SetX(float x) { fX = x; }
void SetY(float y) { fY = y; }

ClassDef(MyClass,1)
};

#endif
[/code]

the linkfile

[code]//file linkdef.c:

#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class MyClass;

#endif
[/code]

Then I executed the following command line to create the dictionary file:

rootcint -f myDict.cxx myClass.h linkdef.h

Which produced this error message:

Limitation: Reference member not supported. Please use pointer FILE:C:\root/include\TGenericClassInfo.h LINE:28

But this is the same error as before!

At least rootcint does something. This small file is generated:

[code]//file myDict.cxx:

//
// File generated by rootcint at Mon Aug 23 10:28:13 2004.
// Do NOT change. Changes will be lost next time file is generated
//

#include “RConfig.h”
#if !defined(R__ACCESS_IN_SYMBOL)
//Break the privacy of classes – Disabled for the moment
#define private public
#define protected public
#endif

#include “TClass.h”
#include “TBuffer.h”
#include “TStreamerInfo.h”
#include “TMemberInspector.h”
#include “TError.h”

#ifndef G__ROOT
#define G__ROOT
#endif

// Since CINT ignores the std namespace, we need to do so in this file.
namespace std {} using namespace std;

#include “RtypesImp.h”

#include “TVectorProxy.h”

#include “myClass.h”

namespace ROOT {
namespace Shadow {
} // Of namespace ROOT::Shadow
} // Of namespace ROOT
[/code]

Which seems only to be an empty hull not containing anything specific.

Maybe this helps understanding the problem better.

Thank you for the help!

tobias

Hi Tobias,

Please re-read my previous answer, you are still missing the option “-c” when you call rootcint.

Cheers,
Philippe.

Thank you very much!

Both ways of solving the problem are working! If someone who has the same problem is reading this later on:

If there is a message like this

there are two possible ways to go. You can either edit the line of the above mentioned file and write

#ifndef __CINT__ const type_info &fInfo; //this is LINE 28 making trouble #endif

or you can simply execute your rootcint command line with the “-c” option. Both will make the message disappear and the output file looks good.

As I said before, thank you all very much for your fast help!

tobias :smiley: