greetings everyone!
i am currently working on getting ROOT to interface with QT, the the primary goal of having a QT gui display ROOT histograms and the like. I have read the chapter in the users guide about doing this and have successfully installed a local version of QT 4.6.3 and ROOT 5.24 (with both qt and qtgsi enabled).
I am trying to get the following example (which is found in the users guide) to compile and run.
[code]// Minimal ROOT based Qt example
#include <qapplication.h>
#include
#include <TGraph.h>
#include <TQtWidget.h>
#include <TCanvas.h>
#include <TQtRootApplication.h>
int main( int argc, char **argv ) {
QApplication *app = new QApplication(argc, argv);
TQtWidget *MyWidget= new TQtWidget(0,“MyWidget”);
// Create any other Qt-widget here
MyWidget->show();
MyWidget->GetCanvas()->cd();
TGraph *mygraph;
float x[3] = {1,2,3};
float y[3] = {1.5, 3.0, 4.5};
mygraph = new TGraph(3,x,y);
mygraph->SetMarkerStyle(20);
mygraph->Draw(“AP”);
MyWidget->GetCanvas()->Update();
app->exec();
return 0;
}[/code]
here is my .pro file
TEMPLATE = app thread
CONFIG -= moc
INCLUDEPATH += "/usr/include/boost/"
INCLUDEPATH += "/home/mpgussert/MyROOT/include/root"
CREATE_ROOT_DICT_FOR_CLASSES = $$HEADERS LinkDef.h
include("/home/MyROOT/include/root/rootcint.pri")
include("/home/MyROOT/include/root/TQtWidget.cw")
LIBS += -L/home/mpgussert/MyROOT/lib/root -lCore -lCint -lRIO -lNet -lHist -lGraf \
-lGraf3d -lGpad -lTree -lRint -lPostscript \
-lMatrix -lPhysics -lMathCore -lThread -lGui -lGQt \
-pthread -lm -ldl -rdynamic
SOURCES += \
main.cpp[/code]
this compiles fine, but when i run it, it opens cint, and then segfaults. that's when i realized i hadn't compiled qtcint. i am assuming this is the problem... alas, qtcint will not compile ...
here is the output from gmake qtcint...
[code]Running build/unix/compiledata.sh
Changing include/compiledata.h
bin/rmkdepend -R -fcint/cint/src/loadfile_tmp.d -Y -w 1000 -- -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -Icint/cint/inc -Icint/cint/src -Icint/cint/src/dict -pthread -UR__HAVE_CONFIG -DROOTBUILD -I. -D__cplusplus -- cint/cint/src/loadfile_tmp.cxx
g++ -O2 -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -Icint/cint/inc -Icint/cint/src -Icint/cint/src/dict -pthread -UR__HAVE_CONFIG -DROOTBUILD -I. -o cint/cint/src/loadfile_tmp.o -c cint/cint/src/loadfile_tmp.cxx
g++ -m64 -O2 -o cint/cint/main/cint_tmp cint/cint/main/cppmain.o \
cint/cint/src/g__cfunc.o cint/cint/main/G__setup.o cint/cint/src/Api.o cint/cint/src/auxu.o cint/cint/src/BaseCls.o cint/cint/src/bc_assign.o cint/cint/src/bc_autoobj.o cint/cint/src/bc_cfunc.o cint/cint/src/bc_debug.o cint/cint/src/bc_eh.o cint/cint/src/bc_exec.o cint/cint/src/bc_inst.o cint/cint/src/bc_item.o cint/cint/src/bc_parse.o cint/cint/src/bc_reader.o cint/cint/src/bc_type.o cint/cint/src/bc_vtbl.o cint/cint/src/CallFunc.o cint/cint/src/cast.o cint/cint/src/Class.o cint/cint/src/DataMbr.o cint/cint/src/debug.o cint/cint/src/decl.o cint/cint/src/disp.o cint/cint/src/dump.o cint/cint/src/end.o cint/cint/src/error.o cint/cint/src/expr.o cint/cint/src/fread.o cint/cint/src/func.o cint/cint/src/gcoll.o cint/cint/src/global1.o cint/cint/src/global2.o cint/cint/src/ifunc.o cint/cint/src/inherit.o cint/cint/src/init.o cint/cint/src/input.o cint/cint/src/intrpt.o cint/cint/src/loadfile_tmp.o cint/cint/src/macro.o cint/cint/src/malloc.o cint/cint/src/memtest.o cint/cint/src/MethodAr.o cint/cint/src/Method.o cint/cint/src/new.o cint/cint/src/newlink.o cint/cint/src/oldlink.o cint/cint/src/opr.o cint/cint/src/parse.o cint/cint/src/pause.o cint/cint/src/pcode.o cint/cint/src/pragma.o cint/cint/src/quote.o cint/cint/src/random.o cint/cint/src/rflx_gendict.o cint/cint/src/rflx_gensrc.o cint/cint/src/rflx_tools.o cint/cint/src/scrupto.o cint/cint/src/Shadow.o cint/cint/src/shl.o cint/cint/src/sizeof.o cint/cint/src/strbuf.o cint/cint/src/struct.o cint/cint/src/stub.o cint/cint/src/tmplt.o cint/cint/src/Token.o cint/cint/src/Type.o cint/cint/src/typedef.o cint/cint/src/Typedf.o cint/cint/src/val2a.o cint/cint/src/value.o cint/cint/src/var.o cint/cint/src/dict/Apiif.o cint/cint/src/dict/stdstrct.o cint/cint/src/dict/gcc4strm.o cint/cint/src/dict/longif3.o -lm -ldl -rdynamic
cp core/utils/src/rootcint.cxx core/utils/src/rootcint_tmp.cxx
bin/rmkdepend -R -fcore/utils/src/rootcint_tmp.d -Y -w 1000 -- -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -UR__HAVE_CONFIG -DROOTBUILD -D__cplusplus -- core/utils/src/rootcint_tmp.cxx
g++ -O2 -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -UR__HAVE_CONFIG -DROOTBUILD -o core/utils/src/rootcint_tmp.o -c core/utils/src/rootcint_tmp.cxx
cp core/utils/src/RStl.cxx core/utils/src/RStl_tmp.cxx
bin/rmkdepend -R -fcore/utils/src/RStl_tmp.d -Y -w 1000 -- -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -UR__HAVE_CONFIG -DROOTBUILD -D__cplusplus -- core/utils/src/RStl_tmp.cxx
g++ -O2 -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -pthread -UR__HAVE_CONFIG -DROOTBUILD -o core/utils/src/RStl_tmp.o -c core/utils/src/RStl_tmp.cxx
cp cint/iosenum/iosenum.linuxx8664gcc3 cint/cint/include/iosenum.h
g++ -m64 -O2 -o core/utils/src/rootcint_tmp \
core/utils/src/rootcint_tmp.o core/utils/src/RStl_tmp.o core/metautils/src/RConversionRuleParser.o core/metautils/src/TClassEdit.o cint/cint/src/g__cfunc.o cint/cint/main/G__setup.o cint/cint/src/Api.o cint/cint/src/auxu.o cint/cint/src/BaseCls.o cint/cint/src/bc_assign.o cint/cint/src/bc_autoobj.o cint/cint/src/bc_cfunc.o cint/cint/src/bc_debug.o cint/cint/src/bc_eh.o cint/cint/src/bc_exec.o cint/cint/src/bc_inst.o cint/cint/src/bc_item.o cint/cint/src/bc_parse.o cint/cint/src/bc_reader.o cint/cint/src/bc_type.o cint/cint/src/bc_vtbl.o cint/cint/src/CallFunc.o cint/cint/src/cast.o cint/cint/src/Class.o cint/cint/src/DataMbr.o cint/cint/src/debug.o cint/cint/src/decl.o cint/cint/src/disp.o cint/cint/src/dump.o cint/cint/src/end.o cint/cint/src/error.o cint/cint/src/expr.o cint/cint/src/fread.o cint/cint/src/func.o cint/cint/src/gcoll.o cint/cint/src/global1.o cint/cint/src/global2.o cint/cint/src/ifunc.o cint/cint/src/inherit.o cint/cint/src/init.o cint/cint/src/input.o cint/cint/src/intrpt.o cint/cint/src/loadfile_tmp.o cint/cint/src/macro.o cint/cint/src/malloc.o cint/cint/src/memtest.o cint/cint/src/MethodAr.o cint/cint/src/Method.o cint/cint/src/new.o cint/cint/src/newlink.o cint/cint/src/oldlink.o cint/cint/src/opr.o cint/cint/src/parse.o cint/cint/src/pause.o cint/cint/src/pcode.o cint/cint/src/pragma.o cint/cint/src/quote.o cint/cint/src/random.o cint/cint/src/rflx_gendict.o cint/cint/src/rflx_gensrc.o cint/cint/src/rflx_tools.o cint/cint/src/scrupto.o cint/cint/src/Shadow.o cint/cint/src/shl.o cint/cint/src/sizeof.o cint/cint/src/strbuf.o cint/cint/src/struct.o cint/cint/src/stub.o cint/cint/src/tmplt.o cint/cint/src/Token.o cint/cint/src/Type.o cint/cint/src/typedef.o cint/cint/src/Typedf.o cint/cint/src/val2a.o cint/cint/src/value.o cint/cint/src/var.o cint/cint/src/dict/Apiif.o cint/cint/src/dict/stdstrct.o cint/cint/src/dict/gcc4strm.o cint/cint/src/dict/longif3.o -lm -ldl -rdynamic
build/unix/makecintdll.sh linux C++ qtcint qt \
" -p -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/home/mpgussert/programs/QT/qt/mkspecs/default -I. -I/home/mpgussert/programs/QT/qt/include -I/home/mpgussert/programs/QT/qt/include/Qt -I/home/mpgussert/programs/QT/qt/include/Qt3Support -I/home/mpgussert/programs/QT/qt/include/QtAssistant -I/home/mpgussert/programs/QT/qt/include/QtCore -I/home/mpgussert/programs/QT/qt/include/QtDBus -I/home/mpgussert/programs/QT/qt/include/QtDeclarative -I/home/mpgussert/programs/QT/qt/include/QtDesigner -I/home/mpgussert/programs/QT/qt/include/QtGui -I/home/mpgussert/programs/QT/qt/include/QtHelp -I/home/mpgussert/programs/QT/qt/include/QtMultimedia -I/home/mpgussert/programs/QT/qt/include/QtNetwork -I/home/mpgussert/programs/QT/qt/include/QtOpenGL -I/home/mpgussert/programs/QT/qt/include/QtOpenVG -I/home/mpgussert/programs/QT/qt/include/QtScript -I/home/mpgussert/programs/QT/qt/include/QtScriptTools -I/home/mpgussert/programs/QT/qt/include/QtSql -I/home/mpgussert/programs/QT/qt/include/QtSvg -I/home/mpgussert/programs/QT/qt/include/QtTest -I/home/mpgussert/programs/QT/qt/include/QtUiTools -I/home/mpgussert/programs/QT/qt/include/QtWebKit -I/home/mpgussert/programs/QT/qt/include/QtXml -I/home/mpgussert/programs/QT/qt/include/QtXmlPatterns qtcint.h " \
"cint/cint/main/cint_tmp" "core/utils/src/rootcint_tmp -cint" \
"build/unix/makelib.sh " "g++" "gcc" "g++" "-O2" \
"-pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -Icint/cint/inc -Icint/cint/src -Icint/cint/src/dict -pthread -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/home/mpgussert/programs/QT/qt/mkspecs/default -I. -I/home/mpgussert/programs/QT/qt/include -I/home/mpgussert/programs/QT/qt/include/Qt -I/home/mpgussert/programs/QT/qt/include/Qt3Support -I/home/mpgussert/programs/QT/qt/include/QtAssistant -I/home/mpgussert/programs/QT/qt/include/QtCore -I/home/mpgussert/programs/QT/qt/include/QtDBus -I/home/mpgussert/programs/QT/qt/include/QtDeclarative -I/home/mpgussert/programs/QT/qt/include/QtDesigner -I/home/mpgussert/programs/QT/qt/include/QtGui -I/home/mpgussert/programs/QT/qt/include/QtHelp -I/home/mpgussert/programs/QT/qt/include/QtMultimedia -I/home/mpgussert/programs/QT/qt/include/QtNetwork -I/home/mpgussert/programs/QT/qt/include/QtOpenGL -I/home/mpgussert/programs/QT/qt/include/QtOpenVG -I/home/mpgussert/programs/QT/qt/include/QtScript -I/home/mpgussert/programs/QT/qt/include/QtScriptTools -I/home/mpgussert/programs/QT/qt/include/QtSql -I/home/mpgussert/programs/QT/qt/include/QtSvg -I/home/mpgussert/programs/QT/qt/include/QtTest -I/home/mpgussert/programs/QT/qt/include/QtUiTools -I/home/mpgussert/programs/QT/qt/include/QtWebKit -I/home/mpgussert/programs/QT/qt/include/QtXml -I/home/mpgussert/programs/QT/qt/include/QtXmlPatterns" "-pipe -m64 -Wall -W -fPIC -Iinclude -DR__HAVE_CONFIG -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -Icint/cint/inc -Icint/cint/src -Icint/cint/src/dict -pthread" \
"-m64 -O2 -L/home/mpgussert/programs/QT/qt/lib -lQtCore -lQtGui -lQt3Support -lQtOpenGL -lQtSvg -lQtXml" "-shared -Wl,-soname," \
"so" "gnu" "-o "
cint/cint/main/cint_tmp -K -w1 -zqtcint -ncint/cint/lib/qt/G__qtcint.cxx -D__MAKECINT__ -DG__MAKECINT -c-1 -Z0 -Icint/cint/lib/qt -p -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/home/mpgussert/programs/QT/qt/mkspecs/default -I. -I/home/mpgussert/programs/QT/qt/include -I/home/mpgussert/programs/QT/qt/include/Qt -I/home/mpgussert/programs/QT/qt/include/Qt3Support -I/home/mpgussert/programs/QT/qt/include/QtAssistant -I/home/mpgussert/programs/QT/qt/include/QtCore -I/home/mpgussert/programs/QT/qt/include/QtDBus -I/home/mpgussert/programs/QT/qt/include/QtDeclarative -I/home/mpgussert/programs/QT/qt/include/QtDesigner -I/home/mpgussert/programs/QT/qt/include/QtGui -I/home/mpgussert/programs/QT/qt/include/QtHelp -I/home/mpgussert/programs/QT/qt/include/QtMultimedia -I/home/mpgussert/programs/QT/qt/include/QtNetwork -I/home/mpgussert/programs/QT/qt/include/QtOpenGL -I/home/mpgussert/programs/QT/qt/include/QtOpenVG -I/home/mpgussert/programs/QT/qt/include/QtScript -I/home/mpgussert/programs/QT/qt/include/QtScriptTools -I/home/mpgussert/programs/QT/qt/include/QtSql -I/home/mpgussert/programs/QT/qt/include/QtSvg -I/home/mpgussert/programs/QT/qt/include/QtTest -I/home/mpgussert/programs/QT/qt/include/QtUiTools -I/home/mpgussert/programs/QT/qt/include/QtWebKit -I/home/mpgussert/programs/QT/qt/include/QtXml -I/home/mpgussert/programs/QT/qt/include/QtXmlPatterns qtcint.h
Note: Bit-field not accessible from interpreter /home/mpgussert/programs/QT/qt/include/QtCore/qstring.h:598:
Warning: Pure virtual destructor may cause problem. Define as 'virtual ~QObjectData() { }' /home/mpgussert/programs/QT/qt/include/QtCore/qobject.h:100:
Error: class,struct,union or type RestrictedBool not defined /home/mpgussert/programs/QT/qt/include/QtCore/qscopedpointer.h:127:
!!!Removing cint/cint/lib/qt/G__qtcint.cxx cint/cint/lib/qt/G__qtcint.h !!!
g++ -O2 -pipe -m64 -Wall -W -Woverloaded-virtual -fPIC -Iinclude -DR__HAVE_CONFIG -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -Icint/cint/inc -Icint/cint/src -Icint/cint/src/dict -pthread -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_DLL -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/home/mpgussert/programs/QT/qt/mkspecs/default -I. -I/home/mpgussert/programs/QT/qt/include -I/home/mpgussert/programs/QT/qt/include/Qt -I/home/mpgussert/programs/QT/qt/include/Qt3Support -I/home/mpgussert/programs/QT/qt/include/QtAssistant -I/home/mpgussert/programs/QT/qt/include/QtCore -I/home/mpgussert/programs/QT/qt/include/QtDBus -I/home/mpgussert/programs/QT/qt/include/QtDeclarative -I/home/mpgussert/programs/QT/qt/include/QtDesigner -I/home/mpgussert/programs/QT/qt/include/QtGui -I/home/mpgussert/programs/QT/qt/include/QtHelp -I/home/mpgussert/programs/QT/qt/include/QtMultimedia -I/home/mpgussert/programs/QT/qt/include/QtNetwork -I/home/mpgussert/programs/QT/qt/include/QtOpenGL -I/home/mpgussert/programs/QT/qt/include/QtOpenVG -I/home/mpgussert/programs/QT/qt/include/QtScript -I/home/mpgussert/programs/QT/qt/include/QtScriptTools -I/home/mpgussert/programs/QT/qt/include/QtSql -I/home/mpgussert/programs/QT/qt/include/QtSvg -I/home/mpgussert/programs/QT/qt/include/QtTest -I/home/mpgussert/programs/QT/qt/include/QtUiTools -I/home/mpgussert/programs/QT/qt/include/QtWebKit -I/home/mpgussert/programs/QT/qt/include/QtXml -I/home/mpgussert/programs/QT/qt/include/QtXmlPatterns -I. -o cint/cint/lib/qt/G__qtcint.o -Icint/cint/lib/qt -c cint/cint/lib/qt/G__qtcint.cxx
g++: cint/cint/lib/qt/G__qtcint.cxx: No such file or directory
g++: no input files
g++ -shared -Wl,-soname,qtcint.so -m64 -O2 -L/home/mpgussert/programs/QT/qt/lib -lQtCore -lQtGui -lQt3Support -lQtOpenGL -lQtSvg -lQtXml -o cint/cint/include/qtcint.so cint/cint/lib/qt/G__qtcint.o
g++: cint/cint/lib/qt/G__qtcint.o: No such file or directory
mv: cannot stat `cint/cint/include/qtcint.so': No such file or directory
rm core/utils/src/RStl_tmp.cxx core/utils/src/rootcint_tmp.cxx
any help with compiling qtcint would be greatly appreciated!
thanks!
Gus