I suppose you should change
> #include <TROOT.h>
> #include <TFile.h>
> #include <TTree.h>
into
> #include "TROOT.h"
> #include "TFile.h"
> #include "TTree.h"
<> is used for searching in system paths, "" in other paths
Damir
HP Wei wrote:
>
> Dear rooters,
> I am compiling this simple code with
> g++ under Solaris 2.7 but am getting
> a lot of `undefined reference to', such as TTree, TROOT
> etc, when linking.
>
> can anyone tell me what I am missing?
> Or can anyone email me a working makefile?
> Thanks,
> hp
>
> ------ test program t.C ---------------
> #include <stdlib.h>
> #include <iostream>
>
> #include <TROOT.h>
> #include <TFile.h>
> #include <TTree.h>
>
> TROOT root("test", "Test compiling");
>
> int main(void)
> {
>
> TTree *tree = new TTree("T", "table");
>
> return 0;
> }
>
> -------------
> TO compile:
> g++ -c t.C -fPIC -Wall -g -I$(ROOTSYS)/include
>
> TO link:
> g++ -g -o t t.o -L(pathname) -lNew -lCore (and others) -L(otherpath) -lm
>
>
--
=====================================================================
| Damir Buskulic | Universite de Savoie/LAPP |
| | Chemin de Bellevue, B.P. 110 |
| Tel : +33 (0)450091600 | F-74941 Annecy-le-Vieux Cedex |
| e-mail: buskulic@lapp.in2p3.fr | FRANCE |
=====================================================================
mailto:buskulic@lapp.in2p3.fr
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:27 MET