I would like to ask if it is possible to include somehow the headers for minuit minimizator inside mine c++ program.
and then to compile it for example with the command: "g++ tes.cpp"
If not, is there any other possible way to use minuit inside my program without doing anything through root console…
I am interested in doing the exact same thing as demosthenis. I can successfully run minexam.cxx form the root console, but I can’t compile the file. I used the following linux command:
/tmp/ccg5rcuf.o(.text+0x36): In function minexam()':: undefined reference toTStopwatch::TStopwatch()’
/tmp/ccg5rcuf.o(.text+0x45): In function minexam()':: undefined reference toTVirtualFitter::Fitter(TObject*, int)’
/tmp/ccg5rcuf.o(.text+0x69): In function minexam()':: undefined reference toTStopwatch::Start(bool)’
/tmp/ccg5rcuf.o(.text+0x38b): In function minexam()':: undefined reference toTStopwatch::CpuTime()’
/tmp/ccg5rcuf.o(.gnu.linkonce.t._ZN10TStopwatchD1Ev+0xb): In function TStopwatch::~TStopwatch()':: undefined reference tovtable for TStopwatch’
/tmp/ccg5rcuf.o(.gnu.linkonce.t._ZN10TStopwatchD1Ev+0x16): In function TStopwatch::~TStopwatch()':: undefined reference toTObject::~TObject()’
/tmp/ccg5rcuf.o(.gnu.linkonce.t._ZN10TStopwatchD1Ev+0x30): In function TStopwatch::~TStopwatch()':: undefined reference toTObject::operator delete(void*)'
collect2: ld returned 1 exit status
minexam.exe: error while loading shared libraries: libCore.so.5.14: cannot open shared object file: No such file or directory
I can change the error message to complain about any of the lib*.so.5.14 files corresponding to: -lCore -lCint -lMinuit -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lpthread -lm or -rdynamic by changing the order in which they are called (checked only with -lCore, -lCint and -lMinuit).
All files exist and seem to be valid. I am the owner and creator of the files and have read, writte and execute permission.
Does anybody have any clue how to solve this problem?
Hi,
set PATH (or LD_LIBRARY_PATH) to include the directory where these libraries are in. That’s usually “export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH”. Then start ROOT.
Axel.
thanks for the advice. I have tried to adjust LD_LIBRARY_PATH before, but did not start root afterwards. Although I do not understand why, it made a difference and minexam.exe finally started do do something, but I doubt that the following output is what should be expected:
[b]Starting timer
*** Break *** segmentation violation
(no debugging symbols found)…Using host libthread_db library “/lib/tls/libthread_db.so.1”.
Attaching to program: /proc/3354/exe, process 3354
`shared object read from target memory’ has disappeared; keeping its symbols.
[Thread debugging using libthread_db enabled]
[New Thread -1234712896 (LWP 3354)]
0xffffe410 in __kernel_vsyscall () #1 0xb6735e83 in __waitpid_nocancel () from /lib/tls/libc.so.6 #2 0xb66e02a9 in do_system () from /lib/tls/libc.so.6 #3 0xb68d66bd in system () from /lib/tls/libpthread.so.0 #4 0xb7a5dbab in TUnixSystem::Exec () from ROOTSYS/lib/libCore.so.5.14 #5 0xb7a5e003 in TUnixSystem::StackTrace () from $ROOTSYS/lib/libCore.so.5.14 #6 0xb7a5c04c in TUnixSystem::DispatchSignals () from $ROOTSYS/lib/libCore.so.5.14 #7 0xb7a5a073 in SigHandler () from $ROOTSYS/lib/libCore.so.5.14 #8 0xb7a6056b in sighandler () from $ROOTSYS/lib/libCore.so.5.14 #9 #10 0xb73ac31e in TFitter::FitChisquare () from $ROOTSYS/lib/libMinuit.so.5.14 #11 0xb73ad121 in H1FitChisquare () from $ROOTSYS/lib/libMinuit.so.5.14 #12 0xb73aa9c5 in TFitter::Chisquare () from $ROOTSYS/lib/libMinuit.so.5.14 #13 0x08048d66 in minexam () #14 0x08048b21 in main ()[/b]
Do you also have a clue what this output is trying to tell me?