Message: Re: Undefined reference to Errors to XercesC while Compiling Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: Undefined reference to Errors to XercesC while Compiling 

Forum: Installation and Configuration
Re: None "Undefined Reference to" Errors to XercesC while Compiling (Kolahal Bhattacharya)
Date: 06 May, 2014
From: Michael H. Kelsey <Michael H. Kelsey>

On Tue, 06 May 2014 05:11:23 GMT, Kolahal Bhattacharya wrote:
> Dear All, I installed GEANT 4.9.6.p02 in my 64bit Ubuntu 12.04
> (~/GEANT4.9.6 directory with source, -build, -data, -install
> sub-directories) using cmake. There is no problem as such regarding this
> installation.
> 
> Since, my applications would require GDML-based visualizations, I had
> installed xerces-c-3.1.1 in another directory ~/Xerces/xerces-c-3.1.1
> before GEANT. During GEANT installation, I found some message like
> "Xerces-C found" or equivalent.
> 
> The problem is coming when I am trying to compile my code with #include
> "G4GDMLParser.hh". This particular code is getting compiled but while
> linking the executable, I am getting a lots of "undefined reference to"
> error messages related to xerces.

This is a known "feature" (*cough*) with the Geant4 environment scripts. In addition to running the geant4make.*sh or geant4.*sh scripts to set your G4 runtime environment, you also need to manually add XercesC (and any other external packages) to your environment (PATH and LD_LIBRARY_PATH) before your applications will link and run.

For example, on my MacBook I have a setup script:

  set udir = `pwd`
  cd /Applications/GEANT4/geant4.10.00.p01/share/Geant4-10.0.1/geant4make
  source geant4make.csh
  setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/usr/local/xerces/lib
  cd $udir
  unset udir

You'll need to do something similar for yourself.

We have submitted a feature request so that the G4 scripts themselves take care of the libraries which were specified to CMake, but that will only appear in future releases, not in 9.6 etc.

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

1 None: Re: Undefined reference to Errors to XercesC while Compiling   (Kolahal Bhattacharya - 06 May, 2014)
(_ None: Re: Undefined reference to Errors to XercesC while Compiling   (Ben Morgan - 07 May, 2014)
(_ None: Re: Undefined reference to Errors to XercesC while Compiling   (Kolahal Bhattacharya - 07 May, 2014)
 Add Message Add Message
to: "Re: Undefined reference to Errors to XercesC while Compiling"

 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 ]