LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problems compiling -- undefined references (https://www.linuxquestions.org/questions/linux-newbie-8/problems-compiling-undefined-references-4175514354/)

mohammad taqy bayat 08-12-2014 02:56 AM

problems compiling -- undefined references
 
Hi there,
I'm newbie with Linux and I'm having trouble with compiling a makefile in a 64-bit machin that Ubuntu 12.04( 32-bit) and ROOT 5.34/03 are installed on it. Compiling the makefile results in the following messages:

bayat@bayat:/media/9C2C3AB22C3A8774/tez/BINA/BINA_offline_ForThesis_elasticNtuple$ make
g++ -L/home/bayat/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -lNew -lThread -lMinuit -lPhysics BINAEvent.o Ana.o BINAEventDict.o mwpc_software.o tcpip.o Genbood.o -o ana
BINAEvent.o: In function `~BINAEvent':
/media/9C2C3AB22C3A8774/tez/BINA/BINA_offline_ForThesis_elasticNtuple/BINAEvent.cxx:117: undefined reference to `TObject:: operator delete(void*)'
/media/9C2C3AB22C3A8774/tez/BINA/BINA_offline_ForThesis_elasticNtuple/BINAEvent.cxx:117: undefined reference to `TObject:: operator delete(void*)'
BINAEvent.o: In function `~SelectEvent':
/media/9C2C3AB22C3A8774/tez/BINA/BINA_offline_ForThesis_elasticNtuple/BINAEvent.cxx:121: undefined reference to `TObject:: operator delete(void*)'
/media/9C2C3AB22C3A8774/tez/BINA/BINA_offline_ForThesis_elasticNtuple/BINAEvent.cxx:121: undefined reference to `TObject:: operator delete(void*)'
BINAEvent.o: In function `__static_initialization_and_destruction_0':
/home/bayat/root/include/TVersionCheck.h:34: undefined reference to `TVersionCheck::TVersionCheck(int)'
BINAEvent.o: In function `__static_initialization_and_destruction_0':
/media/9C2C3AB22C3A8774/tez/BINA/BINA_offline_ForThesis_elasticNtuple/BINAEvent.cxx:29: undefined reference to `ROOT::TGenericClassInfo::SetImplFile(char const*, int)'
.
.
.

collect2: ld returned 1 exit status
make: *** [ana] Error 1



Here is the makefile:

ObjSuf = o
SrcSuf = cxx
DllSuf = so
ExeSuf =
OutPutOpt = -o
CXXFLAGS = -g -Wall -fPIC -DOSF1
CXX = g++
CCFLAGS = -g -Wall -DOSF1
CC = gcc
LD = g++
LDFLAGS = -g
SOFLAGS = -shared


ROOTCFLAGS := $(shell root-config --cflags) -DFILL_ON_FLY
ROOTLIBS := $(shell root-config --libs) -lNew -lThread -lMinuit -lPhysics
ROOTGLIBS := $(shell root-config --glibs) -lNew -lThread

#------------------------------------------------------------------------------

EVENTO = BINAEvent.$(ObjSuf) Ana.$(ObjSuf) BINAEventDict.$(ObjSuf) mwpc_software.o tcpip.o Genbood.o
EVENTS = BINAEvent.$(SrcSuf) Ana.$(SrcSuf) BINAEventDict.$(SrcSuf) mwpc_software.c tcpip.c Genbood.c

EVENTLIB = $(ROOTGLIBS)
EVENTEXE = ana

OBJS = $(EVENTO)

#------------------------------------------------------------------------------

.SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)
.PHONY: Aclock Hello Tetris

$(EVENTEXE): $(OBJS)
$(LD) $(ROOTLIBS) $^ $(OutPutOpt) $@
@echo "$@ done"
clean:
@rm -f $(OBJS) core *~ *Dic* ana *.o

.SUFFIXES: .$(SrcSuf)

###

BINAEvent.$(ObjSuf): BINAEvent.h

BINAEventDict.$(SrcSuf): BINAEvent.h BINAEventLinkDef.h
@echo "Generating dictionary $@..."
@rootcint -f $@ -c $^

.$(SrcSuf).$(ObjSuf):
$(CXX) $(CXXFLAGS) $(ROOTCFLAGS) -c $<

.c.$(ObjSuf):
$(CXX) $(CXXFLAGS) $(ROOTCFLAGS) -c $<

Hope that someone can help me. Thanks in advance!!

pan64 08-12-2014 04:37 AM

probably you only need to change the order here:
Code:

$(EVENTEXE): $(OBJS)
<tab>$(LD) $^ $(ROOTLIBS) $(OutPutOpt) $@



All times are GMT -5. The time now is 06:52 PM.