# Garfield Compilation

**URL:** <https://root-forum.cern.ch/t/garfield-compilation/23636>\
**Category:** Garfield++\
**Created:** [January 31, 2017, 9:28am UTC](https://root-forum.cern.ch/t/garfield-compilation/23636 "2017-01-31T09:28:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![muzamilramzan](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@muzamilramzan](https://root-forum.cern.ch/u/muzamilramzan)\
**Post date:** [January 31, 2017, 9:28am UTC](https://root-forum.cern.ch/t/garfield-compilation/23636/1 "2017-01-31T09:28:33Z")

</div>

I am new to Garfield.  
I am compiling an example in Garfield using make file as  
gastable: gastable.C  
g++ -c -O3 `root-config --cflags` -I$(GARFIELD\_HOME)/Include gastable.C  
g++ `root-config --glibs` -lgfortran -lm -o gastable gastable.o $(GARFIELD\_HOME)/Library/libGarfield.a  
rm gastable.o  
On compilation i get the error as  
/home/muzamil/garfield/Library/libGarfield.a(magboltz.o):magboltz-9.01.f:(.text+0xe94bb): more undefined references to `_gfortran_transfer_real' follow /home/muzamil/garfield/Library/libGarfield.a(magboltz.o): In function`readin\_’:  
magboltz-9.01.f:(.text+0xe94e5): undefined reference to `_gfortran_st_read_done' magboltz-9.01.f:(.text+0xe9524): undefined reference to`\_gfortran\_st\_read’  
magboltz-9.01.f:(.text+0xe9536): undefined reference to `_gfortran_transfer_real' magboltz-9.01.f:(.text+0xe954e): undefined reference to`\_gfortran\_transfer\_real’  
magboltz-9.01.f:(.text+0xe955f): undefined reference to `_gfortran_transfer_real' magboltz-9.01.f:(.text+0xe9567): undefined reference to`\_gfortran\_st\_read\_done’  
/home/muzamil/garfield/Library/libGarfield.a(magboltz.o): In function `magboltz2_': magboltz-9.01.f:(.text+0xe986e): undefined reference to`\_gfortran\_stop\_string’  
collect2: error: ld returned 1 exit status  
make: \*\*\* [gastable] Error 1

Please tell me how to solve it.  
Your reply will be appreciated

---

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [January 31, 2017, 9:41am UTC](https://root-forum.cern.ch/t/garfield-compilation/23636/2 "2017-01-31T09:41:15Z")

</div>

> [@Makefile Garfield](https://root-forum.cern.ch/t/makefile-garfield/17475/3):
>
> Try: g++ `root-config --cflags` -o gemseq1 gemseq1.o $(GARFIELD\_HOME)/Library/libGarfield.a `root-config --glibs` -lgfortran -lm -lz or: g++ `root-config --ldflags` -o gemseq1 gemseq1.o $(GARFIELD\_HOME)/Library/libGarfield.a `root-config --glibs` -lgfortran -lm -lz

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [June 21, 2018, 9:12am UTC](https://root-forum.cern.ch/t/garfield-compilation/23636/3 "2018-06-21T09:12:26Z")

</div>

Closed on June 21, 2018, 9:12am UTC

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