LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 02: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, 04:37 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

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


Reply



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 01:58 AM
undefined references when compiling PLIB program Alkibiades Programming 3 03-13-2010 02:18 PM
undefined gfortran references when compiling with g77 StudMuffin Linux - Software 4 02-17-2007 06:06 AM
Compiling garnome 2.14.1 fails in libgnome(undefined references to popt...) Spooled Linux - Software 2 05-10-2006 07:14 PM
texinfo - undefined references during make fitret Linux - Software 1 06-18-2005 02:38 PM

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

All times are GMT -5. The time now is 03:17 PM.

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
Open Source Consulting | Domain Registration