Fortran common and dictionary

Dear rooters
I have problem with generating dictionary to my code. I’m trying writing C++ that calling subroutines from FORTRAN. When I compile this without generating dictionary everything is OK but when I try to generate dictionary I get message:

Error: Symbol _komon is not defined in current scope  Call.h:34:

My working codes look like Test1.tar (10 KB)
But with this i get problem test2.tar (10 KB)

In your call to rootcint, replace “-P” with “-p” (and possibly remove “-I/usr/local/include”, unless you have special needs for it and, as pointed out by Philippe below, the “-I$ROOTSYS” is completely redundant there).
Also, your linker should be g++, not gfortran:
LD = g++
LDOPTS = $(shell root-config --libs)
LDOPTS += $(shell gfortran
LDOPTS += $(shell gfortran -print-file-name=libgfortranbegin.a)

Thank you, I only change flag from -P to -p and now it works. :smiley:


You header is such that it needs to use the compiler’s preprocessor rather than CINT’s, so you need to use the option -p. Rather than: @rootcint -f Dict.cpp -c -P -I$ROOTSYS -I/usr/local/include $(HEADERS)use @rootcint -f Dict.cpp -c -p -I/usr/local/include $(HEADERS)