Hi,
I tried to convert my .cc file to .root using script:
PROGNAME = analysis.e
SOURCEFILES = analysis.cc
OBJS = (patsubst %.cc, %.o, (SOURCEFILES))
ROOTCFLAGS := (shell root-config --cflags)
ROOTLIBS := (shell root-config --libs)
ROOTGLIBS := $(shell root-config --glibs)
LDFLAGS = -O
LIBS += (ROOTLIBS)
CFLAGS += (ROOTCFLAGS)
%.o: %.cc
g++ -Wall {CFLAGS} -c -g -o @ $<
(PROGNAME): (OBJS)
g++ -Wall -o @ (OBJS) (LDFLAGS) (LIBS)
test:
@echo $(ROOTCFLAGS)
clean:
-rm -f {PROGNAME} {OBJS}
but I got this error message:
g++ -Wall -o analysis.e analysis.o -O -L/usr/lib/x86_64-linux-gnu -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic
/usr/lib/gcc/x86_64-linux-gnu/5/…/…/…/x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference to
main’
collect2: error: ld returned 1 exit status
GNUmakefile:17: recipe for target ‘analysis.e’ failed
make: *** [analysis.e] Error 1
What could be problem?
Thank you,
A.analysis.cc (4.4 KB)