How to link static library

I am making a Qt software that uses some ROOT classes (TFile, TTree, …) As my program has to work on machine that do not have ROOT installed, I wish to use static library of ROOT.
To do that, I put the following lines in my .pro file

At the end my Qt project compiles but I get a crash when I run the executable file
This is a part of the backtrace

[quote]#8 0x00000000005079c4 in TROOT::FindSpecialObject (this=0x1e6b8c0, name=0x294f5f0 “G__IOSTREAM_H”, where=
0x2970028) at /home/pamputt/root/core/base/src/TROOT.cxx:850
#9 0x00000000005efb37 in TCint::FindSpecialObject (item=0x294f5f0 “G__IOSTREAM_H”, type=0x7fff9d1641d0, prevObj=0x2970020, assocPtr=0x2970028) at /home/pamputt/root/core/meta/src/TCint.cxx:2114
#10 0x00000000005e5c79 in TCint_FindSpecialObject (c=0x294f5f0 “G__IOSTREAM_H”, ci=0x7fff9d1641d0, p1=0x2970020, p2=0x2970028) at /home/pamputt/root/core/meta/src/TCint.cxx:87[/quote]
I search this error on search engines but it did not return any result.

Do you have any idea of what is going wrong?

The crash disappears if I add “-lCint” in “LIBS”.
However, I guess the executable will be linked dynamically to libCint. Does a static library of Cint exist?

Hi,

If I remember correctly you’ll have to distribute it with your binary. It also needs several extra files: etc, cint/cint/include etc.

Cheers, Axel.

Indeed :smiley:
One more question. Is it possible to force my application to do not use CINT so that I do not need to link Cint dynamically.
What kind of ROOT classes require CINT?
Actually, in my application, I only use TFile and TTree. Do they require CINT?
Thank you for the explanations.

EDIT: I saw there exists a CINT forum. Maybe this post would be better over there.