The g++ line below was the line executed at the shell prompt; the
makefile did contain the backslashes. I'm a little puzzled as to
why this doesn't work; the compiler options are the same as those
in the $ROOTSYS/test directory.
Mark.
On Thu, 1 Oct 1998, Rene Brun wrote:
> Mark Boulay wrote:
> >
> > Root team,
> >
> > I'm trying to compile and link a simple test program
> > on DEC/OSF1 with root 2_00/11. The following is the test file, along
> > with the compiler output. I get similar unresolved messages when
> > trying to build the examples in the $ROOTSYS/test directory.
> >
> > #############################file test_root.C###################
> > #include "TROOT.h"
> > #include "TFile.h"
> > void main()
> > {
> > TROOT theRoot("theRoot","Test");
> > TFile *f1 = new TFile("f1","RECREATE","test file");
> > f1->Close();
> > }
> > ################################################################
> >
> > marie> g++ -o test_file -Wl,-soname -I/$ROOTSYS/include -L/$ROOTSYS/lib
> > -lNew -lBase -lFunc -lCint -lClib -lCont -lFunc -lHist -lHtml -lMatrix
> > -lMeta -lMinuit -lNet -lPostscript -lProof -lTree -lUnix -lZip -lGpad
> > -lGui -lGraf -lGraf3d -lGX11 -lX3d -lXm -lXpm test_root.C
> >
> > /bin/ld:
> > Unresolved:
> > TFile::TFile(char const *, char const *, char const *, int)
> > collect2: ld returned 1 exit status
> > make: *** [test_file] Error 1
> >
>
> This one is easy.
> You simply forgot the backslash in your link procedure. It must be:
> g++ -o test_file -I/$ROOTSYS/include -L/$ROOTSYS/lib \
> -lNew -lBase -lFunc -lCint -lClib -lCont -lFunc -lHist -lHtml -lMatrix \
> -lMeta -lMinuit -lNet -lPostscript -lProof -lTree -lUnix -lZip -lGpad \
> -lGui -lGraf -lGraf3d -lGX11 -lX3d -lXm -lXpm test_root.C
>
> Rene Brun
>