Problem on compiling garfroot.c on ubuntu 12.10

Dear all,
I’m trying to compile garfroot.c on my system but i get the following results:

when I tried to [quote]make[/quote].

I also used the makefiles in the link [url]Garfield++ installation, garfroot.C ,but still not working.

Can anyone tell me what’s the problem ???

try uncommenting the block of lines for the Garfield::ViewCell class in Include/LinkDef.h
(a modified LinkDef.h is attached)
LinkDef.h (1.75 KB)

I have the same error messages when I am trying to compile a garfield++ project using ViewCell, e.g.

/unix/muons/g-2/garfield/Library/libGarfield.a(ViewCell.o): In function `Garfield::ViewCell::IsA() const':
ViewCell.cc:(.text._ZNK8Garfield8ViewCell3IsAEv[Garfield::ViewCell::IsA() const]+0xc): undefined reference to `Garfield::ViewCell::Class()'
/unix/muons/g-2/garfield/Library/libGarfield.a(ViewCell.o):(.data.rel.ro._ZTVN8Garfield8ViewCellE[vtable for Garfield:]+0x1d0): undefined reference to `Garfield::ViewCell::ShowMembers(TMemberInspector&)'
/unix/muons/g-2/garfield/Library/libGarfield.a(ViewCell.o):(.data.rel.ro._ZTVN8Garfield8ViewCellE[vtable for Garfield:]+0x1d8): undefined reference to `Garfield::ViewCell::Streamer(TBuffer&)'
/unix/muons/g-2/garfield/Library/libGarfield.a(ViewGeometry.o): In function `Garfield::ViewGeometry::IsA() const':
ViewGeometry.cc:(.text._ZNK8Garfield12ViewGeometry3IsAEv[Garfield::ViewGeometry::IsA() const]+0xc): undefined reference to `Garfield::ViewGeometry::Class()'
/unix/muons/g-2/garfield/Library/libGarfield.a(ViewGeometry.o):(.data.rel.ro._ZTVN8Garfield12ViewGeometryE[vtable for Garfield::ViewGeometry]+0x1d0): undefined reference to `Garfield::ViewGeometry::ShowMembers(TMemberInspector&)'
/unix/muons/g-2/garfield/Library/libGarfield.a(ViewGeometry.o):(.data.rel.ro._ZTVN8Garfield12ViewGeometryE[vtable for Garfield::ViewGeometry]+0x1d8): undefined reference to `Garfield::ViewGeometry::Streamer(TBuffer&)'
collect2: ld returned 1 exit status

I have looked at the Link.h file as suggested but all linea are already uncommented in there. Are there any other recommendations for how to solve this?

Many thanks,
Tom

Hi Guys

I am having the same problem. Any news on this?

regards

Alex

Hello,

I have exactly the same compilation errors (see first message) with gcc 4.4.7 (and ROOT 5.34/18) on ubuntu 12.04 64 bit and gcc 4.6.3 (and ROOT 5.34/20) on CentOS 6.5 64 bit, using the garfield++ revision 353, the downloaded garfroot.C and the following downloaded makefile :

OBJDIR  = $(GARFIELD_HOME)/Object
SRCDIR  = $(GARFIELD_HOME)/Source
INCDIR  = $(GARFIELD_HOME)/Include
HEEDDIR = $(GARFIELD_HOME)/Heed
LIBDIR  = $(GARFIELD_HOME)/Library

# Compiler (and Linker)
CXX = `root-config --cxx`

# Compiler (and Linker) flags
CXXFLAGS  = `root-config --cflags`
CXXFLAGS += -I$(INCDIR) -I$(HEEDDIR)
# Code Generation and Optimization flags
CXXFLAGS += -fno-common -fPIC -O3
# Warning flags
CXXFLAGS += -W -Wall -Wextra -Wno-long-long
# Debug flags
CXXFLAGS += -g

# Libraries (note: the order matters)
LDLIBS  = -L$(LIBDIR) -Wl,--whole-archive -lGarfield -Wl,--no-whole-archive
# Fortran libraries
LDLIBS += -lgfortran
# ROOT libraries
LDLIBS += `root-config --evelibs`

garfroot: garfroot.C
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LDLIBS)[/code]

The documentation indicates a Garfroot compilation fail known with gcc 4.7 or higher. I used various lower versions, so the gcc version is probably not the origin of this problem. The same error message is also present for me with an old version of garfield++ (revision 294).

Regards,
Alexandre

I have the same problem compiling a simple.C (e.g. modifying the gasfile.C example ) program with ViewCell and ViewGeometry

/home/fwauters/garfield/Library/libGarfield.a(ViewGeometry.o): In function `Garfield::ViewGeometry::IsA() const': ViewGeometry.cc:(.text._ZNK8Garfield12ViewGeometry3IsAEv[Garfield::ViewGeometry::IsA() const]+0xc): undefined reference to `Garfield::ViewGeometry::Class()' /home/fwauters/garfield/Library/libGarfield.a(ViewGeometry.o):(.data.rel.ro._ZTVN8Garfield12ViewGeometryE[vtable for Garfield::ViewGeometry]+0x1d0): undefined reference to `Garfield::ViewGeometry::ShowMembers(TMemberInspector&)' /home/fwauters/garfield/Library/libGarfield.a(ViewGeometry.o):(.data.rel.ro._ZTVN8Garfield12ViewGeometryE[vtable for Garfield::ViewGeometry]+0x1d8): undefined reference to `Garfield::ViewGeometry::Streamer(TBuffer&)'

My Compiler: gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Linux distr: Scientific Linux release 6.5

you can try cmake, good luck

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.