Message: linking with another G4 module Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question linking with another G4 module 

Forum: Installation and Configuration
Date: 06 Jul, 2009
From: Glen Warren <Glen Warren>

I have a number of very similar applications. I have setup a library of G4 base classes which I used for derived classes for my applications. I've used the G4 make system by making a fake application and using the standard GNUmakefile to create the library. For the application which inherits from this group of base classes, I modified the GNUmakefile following http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/BackupVersions/V9.1/html/apas05.html#sect.MkflEnvVar.LnkExtLib. I do not use the last few lines of the example at the bottom of that page as it seems to setup a recursive error loop. I've pasted the makefile for the application at the bottom

This approach works when I explicitly derive classes from my base classes in my application. However, if I try to use the base class directly in my application (e.g. my PhysicsList almost never changes, so I would just like to use it directly), everything compiles, but the linker complains that it cannot find symbols to the various G4 objects that my base class uses (it finds what it needs in the classes derived from my base classes). Does anyone know how to solve this problem?

----------------

name := SLIDet1
G4TARGET := $(name)
G4EXLIB := true

EXTRALIBS += $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libSLIDet1.a \
            -L$(G4WORKDIR)/tmp/$(G4SYSTEM)/GAW -lGAW
EXTRALIBSSOURCEDIRS += $(G4WORKDIR)/projects/SLIDet1 $(G4WORKDIR)/projects/GAW
EXTRA_LINK_DEPENDENCIES := $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(name)/libSLIDet1.a

.PHONY: all
all: lib bin

CPPFLAGS := -O3 -I$(G4WORKDIR)/projects/GAW/include

include $(G4INSTALL)/config/binmake.gmk

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

1 More: Re: linking with another G4 module   (Glen Warren - 29 Jul, 2009)
 Add Message Add Message
to: "linking with another G4 module"

 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 ]