Message: Re: Link error while using ROOT Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

News Re: Link error while using ROOT 

Forum: Installation and Configuration
Re: Question Link error while using ROOT (Dao He)
Date: 02 Mar, 2012
From: Ben Morgan <Ben Morgan>

Hi Dao,

On Fri, 02 Mar 2012 03:12:10 GMT, Dao He wrote:
> I installed geant4.9.4.p03 in my Scientific Linux SL release 5.3 system.
> 
> When I run the example N01, there is no problem.
> 
> However, after I add the following two sentence to the makefile of N01
> for ROOT:
> 
> ---------------------------------------------------------------------------
> 
> LDFLAGS += `root-config --nonew --libs`
> 
> CPPFLAGS += `root-config --cflags
> 
> ---------------------------------------------------------------------------
> 
> I received the message:
> 
> ---------------------------------------------------------------------------
> 
> Using global libraries ...
> 
> Linking exampleN01
> 
> /usr/bin/ld: cannot find -lG4Tree
> 
> collect2: ld returned 1 exit status
> 
> make: *** [/home/hedao/g4work/bin/Linux-g++/exampleN01] Error 1

If you're building exampleN01 o.k. without the LDFLAGS and CPPFLAGS lines, then I don't thinks there's any problem with your Geant4 setup. Additional libraries can be added to a Geant4 Makefile, but via the EXTRALIBS variable (see the Section 6.3 of the Application Developer's Guide Appendix), so I would try changing those lines to:

CPPFLAGS += `root-config --cflags`
EXTRALIBS += `root-config --nonew --libs`

Cheers,

Ben.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Link error while using ROOT   (Dao He - 04 Mar, 2012)
2 None: Re: Link error while using ROOT   (Dao He - 04 Mar, 2012)
 Add Message Add Message
to: "Re: Link error while using ROOT"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]