LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-12-2014, 03:56 AM   #1
mohammad taqy bayat
LQ Newbie
 
Registered: Aug 2014
Posts: 16

Rep: Reputation: Disabled
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!!
 
Old 08-12-2014, 05:37 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,767

Rep: Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886Reputation: 2886
probably you only need to change the order here:
Code:
$(EVENTEXE): $(OBJS)
<tab>$(LD) $^ $(ROOTLIBS) $(OutPutOpt) $@
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 6.9 compiling glibc, fails on make due to undefined references in functions nescalona Linux From Scratch 3 04-03-2010 02:58 AM
undefined references when compiling PLIB program Alkibiades Programming 3 03-13-2010 03:18 PM
undefined gfortran references when compiling with g77 StudMuffin Linux - Software 4 02-17-2007 07:06 AM
Compiling garnome 2.14.1 fails in libgnome(undefined references to popt...) Spooled Linux - Software 2 05-10-2006 08:14 PM
texinfo - undefined references during make fitret Linux - Software 1 06-18-2005 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration