Hi!
First time I write on this forum but used it quite a lot in the past (thanks you for its existence )
Iām writing a stand alone program that required ROOT libraries to work on TFiles.
The first part that uses just c++ functions worked very well and I havenāt any problem with make command.
When I add a function that required TFiles.h and āTTree.hā (but also just adding the corrispective #inlcude in the header) it stop working.
This is the error message after doing make on terminal
g++ -L /usr/include/boost root-config --glibs
-o CSEXE ConfigFile.o CS.o Sorter.o SortRun.o -lboost_system -lboost_filesystem -lboost_thread
CS.o: In function __static_initialization_and_destruction_0': /gate/root/include/TVersionCheck.h:34: undefined reference to
TVersionCheck::TVersionCheck(int)ā
Sorter.o: In function __static_initialization_and_destruction_0': /gate/root/include/TVersionCheck.h:34: undefined reference to
TVersionCheck::TVersionCheck(int)ā
This is my makefile:
CXXFLAGS += -I /usr/include/boost root-config --cflags
LDFLAGS += -L /usr/include/boost root-config --glibs
CPPFLAGS += -MD -MP -ansi -pedantic -Wall -g
SOURCES := $(wildcard *.cc)
CSEXE: $(SOURCES:%.cc=%.o)
$(CXX) $(LDFLAGS) -o $@ $^ -lboost_system -lboost_filesystem -lboost_thread
rm -rf *.d *.o
-include $(SOURCES:%.cc=%.d)
clean:
rm -rf *EXE *.d *.o
Some information:
I always do the source of the .sh file in the root folder.
Everything works properly when I compile my single file programs with:
g++ -Wall -ansi myfile.cxx -o myfileEXE root-config --cflags --glibs
Reading somewhere on the forum I have done a check (I donāt know if it is usefull): writing root-config --glibs
on terminal I obtain this error
-bash: -L/gate/root/lib: No such file or directory
instead of the list of classes.
I ask for your help because Iām very newbie on makefile and all that stuff