Re: [ROOT] Geant4 and ROOT compilation error...

From: Isidro.Gonzalez.Caballero@cern.ch
Date: Fri Jan 11 2002 - 18:56:06 MET


Hi,
	I am using Geant4 and ROOT at the same time and I never had such a
problem. I use the following:

# --------------------------------------------------------------
name := Tiara  <----------- My executable name
G4TARGET := $(name)
G4EXLIB := true <---------- To make a library

.PHONY: all
all: lib bin

include $(G4INSTALL)/config/binmake.gmk

# Root (exlude libNew and libpthread from library list)
ROOTINC       = -DTIARA_USEROOT -I$(ROOTSYS)/include

ROOTLIBS      = $(shell $(ROOTSYS)/bin/root-config --glibs) -lMinuit -lHtml
ROOTLIBS      := $(filter-out -lNew,$(ROOTLIBS))
ROOTLIBS      := $(filter-out -lpthread,$(ROOTLIBS))

# Extra flags for G4

CPPFLAGS += $(ROOTINC)

LDLIBS   += $(ROOTLIBS)
#----------------------------------------------------------------

Hope it works. Cheers,

		Isidro

+---------------------------+--------------------------------+
| Isidro González Caballero | mailto:Isidro.Gonzalez@cern.ch |
| CERN-EP / Mailbox: F28010 | http://home.cern.ch/~iglez/    |
| 1211 Geneva 23            |               -o-              |
| Switzerland               | Tel: +41 22 76 73060, 73316    |
+---------------------------+--------------------------------+


On Fri, 11 Jan 2002, Couder Manoel wrote:

> Hi, 
> I am trying to link ROOT with a Geant4 code.
> I write in the user makefile provide by G4:
> ----------------------------------------------------------------------------------------------------------------
> CPPFLAGS        := $(shell root-config --cflags)
> 
> ROOTLIBS         := $(shell root-config --nonew --libs)
> EXTRALIBS       += $(ROOTLIBS)
> ----------------------------------------------------------------------------------------------------------------
> As they said in the G4 manual to link with external libraries but during the 
> compilation i got this error:
> ----------------------------------------------------------------------------------------------------------------
> In file included from /usr/local/cern/root/include/TString.h:31,
>                  from /usr/local/cern/root/include/TCollection.h:34,
>                  from /usr/local/cern/root/include/TSeqCollection.h:26,
>                  from /usr/local/cern/root/include/TList.h:26,
>                  from /usr/local/cern/root/include/TNamed.h:29,
>                  from /usr/local/cern/root/include/TDirectory.h:25,
>                  from /usr/local/cern/root/include/TROOT.h:29,
>                  from exampleN01.cc:44:
> /usr/local/cern/root/include/TMath.h: In function `Int_t TMath::Finite
> (double)':
> /usr/local/cern/root/include/TMath.h:387: `finite' undeclared (first use this 
> function)
> /usr/local/cern/root/include/TMath.h:387: (Each undeclared identifier is 
> reported only once for each
> function it appears in.)
> /usr/local/cern/root/include/TMath.h: In function `Int_t TMath::IsNaN
> (double)':
> /usr/local/cern/root/include/TMath.h:390: `isnan' undeclared (first use this 
> function)
> ----------------------------------------------------------------------------------------------------------------
> I don't understand the problem, i never had this error when i linked root 
> with my own class.
> Can anyone help me ???
> Thanks a lot
> Manoel
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:38 MET