Dear Katharina Ehrhardt
You can not use the method
QString getName()const;
of your class
Because there is no RootCint dictionary for QString class yet. By the same reason, QString object is no use under CINT interpreter. As a work around you may try to change your class as follows:
#ifndef __CINT__
# include <qstring.h>
#else
class QString;
#endif
#include <TObject.h>
#ifndef __CINT__
# include <qstring.h>
#else
class QString;
#endif
#include <TObject.h>
using namespace std;
class mySmallClass:public TObject
{
private:
#ifndef __CINT__
QString name; //!
#endif
int data;
public:
mySmallClass(const QString& n,int d=0);
~mySmallClass();
int getData()const;
QString &getName()const;
void setData(int d);
ClassDef(mySmallClass,2)
};
in addition you should define your LinkDef.h header file
LinkDef.h:
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class mySmallClass;
#endif
With the corrections above, I did succeed to build to RootCint dictionary for your class as follows:
rootcint myClassDict.cxx -c myClass.h LinkDef.h
Hope this helps.
Valeri
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
On Behalf Of Katharina Ehrhardt
Sent: Tuesday, May 03, 2005 9:31 AM
To: roottalk
Subject: [ROOT] Problem creating dictionaries of classes which contain
Qt-class-members
Hi all
I've encountered a problem in creating dictionaries for header files which
include a Qt header file.
> $ROOTSYS/bin/rootcint -f mySmallClassDict.cpp -c -I$QTDIR/include
mySmallClass.h mySmallClassLinkDef.h
Error: Illegal pointer operation (tovalue)
FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:148
Error: operator '/' divided by zero
FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:148
Syntax Error: defined(_SCO_DS)/*SCOOpenServer5+GCC*/
FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:148
Error: Illegal pointer operation (tovalue)
FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:150
Error: operator '/' divided by zero
FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:150 Syntax Error: defined(__USLC__)/*allSCOplatforms+UDKorOUDK*/ FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:150Error: Illegal pointer operation (tovalue) FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:153 Syntax Error: defined(__svr4__)&&defined(i386)/*OpenUNIX8+GCC*/ FILE:/opt/qt-3.3.2-gcc3/include/qglobal.h LINE:153
and my header file looks like:
#include <qstring.h>
#include <TObject.h>
using namespace std;
class mySmallClass:public TObject
{
private: QString name; //! int data; public: mySmallClass(const QString& n="",int d=0); ~mySmallClass(); int getData()const; QString getName()const; void setData(int d); ClassDef(mySmallClass,2)
Greetings
Katharina Ehrhardt
Received on Tue May 03 2005 - 16:37:56 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:07 MET