# Garfield++ installation, garfroot.C

**URL:** <https://root-forum.cern.ch/t/garfield-installation-garfroot-c/15393>\
**Category:** Garfield++\
**Created:** [December 19, 2012, 11:59am UTC](https://root-forum.cern.ch/t/garfield-installation-garfroot-c/15393 "2012-12-19T11:59:50Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Francisco\_Molina](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/ecae2f/32.png) [@Francisco\_Molina](https://root-forum.cern.ch/u/Francisco_Molina)\
**Post date:** [December 19, 2012, 2:39pm UTC](https://root-forum.cern.ch/t/garfield-installation-garfroot-c/15393/5 "2012-12-19T14:39:54Z")

</div>

Thanks again Wile E. Coyote!.. Now compiles!!.. Just in case I will leave here the proper makefile.  
###################makefile##############################33

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

CXX = g++
CXXFLAGS = -g -Wall -fPIC -m64
LD = g++
SOFLAGS = shared

# Compiler flags
CFLAGS = -Wall -Wextra -Wno-long-long \
	`root-config --cflags` \
	-O3 -fno-common -c \
	-I$(INCDIR) -I$(HEEDDIR)

# Debug flags
CFLAGS += -g

LDFLAGS=-L$(LIBDIR) -Wl,--whole-archive -lGarfield -Wl,--no-whole-archive
LDFLAGS+=`root-config --evelibs` -lgfortran -lm -lz

garfroot:	garfroot.C 
	$(CXX) $(CFLAGS) garfroot.C
	$(CXX) `root-config --cflags` -o garfroot garfroot.o $(LDFLAGS)
# $(CXX) -o garfroot garfroot.o $(LDFLAGS)
	rm garfroot.o
```

---

_[View the full topic](https://root-forum.cern.ch/t/garfield-installation-garfroot-c/15393)._
