Hi,
following the compiling how-to I copied Makefile.arch from my root/test folder and then I did the following Makefile (which I don’t fully understand…):
include Makefile.arch
read_bin2O = read_bin2.$(ObjSuf)
read_bin2S = read_bin2.$(SrcSuf)
read_bin2 = read_bin2$(ExeSuf)
$(read_bin2): $(read_bin2O)
$(LD) $(LDFLAGS) $^ $(LIBS) $(OutPutOpt) $@
@echo "$@ done"
.SUFFIXES: .$(SrcSuf)
.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) -c $<
OBJ_FILES = $(read_bin2O)
EXE_FILES = $(read_bin2)
.PHONY : clean
clean:
rm $(OBJ_FILES) $(EXE_FILES)
but I get this error:
fede@PMTanalisis:~/usr2/fuentes$ make read_bin2
cc -c -o read_bin2.o read_bin2.c
read_bin2.c:4:19: error: TROOT.h: No such file or directory
read_bin2.c:5:21: error: TNtuple.h: No such file or directory
read_bin2.c:6:20: error: TStyle.h: No such file or directory
read_bin2.c:7:19: error: TFile.h: No such file or directory
read_bin2.c: In function ‘ntuple_gen’:
read_bin2.c:28: error: ‘TFile’ undeclared (first use in this function)
read_bin2.c:28: error: (Each undeclared identifier is reported only once
read_bin2.c:28: error: for each function it appears in.)
read_bin2.c:28: error: ‘file’ undeclared (first use in this function)
read_bin2.c:28: error: expected ‘;’ before ‘:’ token
read_bin2.c:29: error: ‘TNtuple’ undeclared (first use in this function)
read_bin2.c:29: error: ‘nt’ undeclared (first use in this function)
read_bin2.c:29: error: ‘new’ undeclared (first use in this function)
read_bin2.c:29: error: expected ‘;’ before ‘TNtuple’
make: *** [read_bin2.o] Error 1
doing root-config --arch gives me linux. (I’m running ubuntu server 8.04)
Looking in other threads I found that doing the following works perfectly:
g++ `root-config --cflags --glibs` read_bin2.c -o read_bin2
so, I wonder what I’m doing wrong in my Makefile…
Ok, hope you can help me. Thanks.
fede.