Re: Problems linking under RedHat Linux 5.2

Rene Brun (Rene.Brun@cern.ch)
Tue, 16 Jun 1998 18:59:37 +0200


Hi David,
I suppose that you have imported the egcs version of Root.
See the $ROOTSYS/test/Makefile for the compile options.
You should compile your code with the options
-fno-rtti -fno-exceptions

Rene Brun

David F. Nitz wrote:
>
> I've just started to try to port some of my root programs from Windows95
> to Linux. I took the makefile in the "test" subdirectory of the root
> (2.00/8) release and modified it for my program. This same program has
> been successfully compiled, linked, and run under Windows95. When I try
> to build it under Linux I get the following error message:
>
> [dfnitz@auger3 trigger_sim]$ make
> g++ -g fast_trg_bkg.o AUGERFastTrg.o AUGERFastTrgCint.o \
> -L/usr/local/cern/root/lib -lNew -lBase -lCint -lClib -lCont -lFunc -lGraf
> -lGraf3d -lHist -lHtml -lMatrix -lMeta -lMinuit -lNet -lPostscript -lProof
> -lTree -lUnix -lZip -lg++ -lm -ldl -rdynamic -o fast_trg_bkg
> AUGERFastTrgCint.o: In function `AUGERFastTrg type_info function':
> AUGERFastTrgCint.o(.text+0x1e6c): undefined reference to `TObject
> type_info function'
> AUGERFastTrgCint.o(.text+0x1e72): undefined reference to `TObject
> type_info node'
> collect2: ld returned 1 exit status
> make: *** [fast_trg_bkg] Error 1
> [dfnitz@auger3 trigger_sim]$
>
> This is my Makefile:
> ----------------------------------------------------------------------
> ObjSuf = o
> SrcSuf = cxx
> ExeSuf =
> DllSuf = so
> OutPutOpt = -o
>
> ROOTLIBS = -L$(ROOTSYS)/lib -lNew -lBase -lCint -lClib -lCont -lFunc \
> -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMeta -lMinuit -lNet \
> -lPostscript -lProof -lTree -lUnix -lZip
> ROOTGLIBS = -lGpad -lGui -lGX11 -lX3d
>
> # Linux
> CXX = g++
> CXXFLAGS = -O -Wall -fPIC -I$(ROOTSYS)/include
> LD = g++
> LDFLAGS = -g
> SOFLAGS = -Wl,-soname,libEvent.so -shared
> LIBS = $(ROOTLIBS) -lg++ -lm -ldl -rdynamic
> GLIBS = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
> -lXpm -lX11 -lg++ -lm -ldl -rdynamic
>
> #------------------------------------------------------------------------------
>
> all: fast_trg_bkg
>
> ###
> AUGERFastTrgCint.cxx: AUGERFastTrg.h
> @echo "Generating dictionary ..."
> @rootcint -f AUGERFastTrgCint.cxx -c AUGERFastTrg.h
>
> fast_trg_bkg: fast_trg_bkg.o AUGERFastTrg.o AUGERFastTrgCint.o
> $(LD) $(LDFLAGS) fast_trg_bkg.o AUGERFastTrg.o AUGERFastTrgCint.o \
> $(LIBS) $(OutPutOpt) fast_trg_bkg
> @echo "fast_trg_bkg done"
>
> clean:
> rm AUGERFastTrgCint.cxx *.o fast_trg_bkg
>
> .SUFFIXES: .$(SrcSuf)
> .$(SrcSuf).$(ObjSuf):
> $(CXX) $(CXXFLAGS) -c $<
>
> ---------------------------------------------------------------------------
>
> Any suggestions?
>
> David F. Nitz
> Physics Department, University of Michigan
> dfnitz@umich.edu
>
>