Undefined reference to `TPythia6::TPythia6()'

I attempted to compile the the file I include below with the following command

g++ -o genEvent genEvent2.C root-config --cflags --libs

The following is the error I receive

/tmp/ccdMj52D.o: In function main': genEvent2.C:(.text+0x42): undefined reference toTPythia6::TPythia6()’
genEvent2.C:(.text+0x99): undefined reference to TPythia6::Initialize(char const*, char const*, char const*, float)' genEvent2.C:(.text+0x252): undefined reference toTPythia6::GenerateEvent()’
genEvent2.C:(.text+0x268): undefined reference to TPythia6::Pylist(int)' genEvent2.C:(.text+0x2f1): undefined reference toTPythia6::Pystat(int)’
collect2: ld returned 1 exit status

Any suggestions greatly appreciated.

Doug Carlson
genEvent2.C (1.92 KB)
genEvent2.C (1.92 KB)

compile and link with:

g++ -o genEvent genEvent2.C `root-config --cflags --libs` \ -lEG -lEGPythia6 -L$PYTHIA6 -lPythia6

where $PYTHIA6 is an env variable pointing to the directory where libPythia6 is installed