Hi,
As “nm Alpgen.so” says the symbol is undefined so may be the reason is that till now I was declaring Sample in my class “Alpgen” as:
static const int Sample= 2;
NOW I added one more line in my .h (outside my class definiton) file which is:
const int Alpgen::Sample; (because it is a static data member!!)
But this also gives an error as listed below:
/tmp/ccsMgafv.o(.rodata+0x0): multiple definition of Alpgen::Sample' /tmp/ccemydi0.o(.rodata+0x0): first defined here /tmp/ccsMgafv.o(.rodata+0x4): multiple definition ofAlpgen::WhichJet’
/tmp/ccemydi0.o(.rodata+0x4): first defined here
/tmp/ccsMgafv.o(.rodata+0x8): multiple definition of Alpgen::WhichPhot' /tmp/ccemydi0.o(.rodata+0x8): first defined here /tmp/ccsMgafv.o(.rodata+0xc): multiple definition ofAlpgen::NJets_upto’
[quote]NOW I added one more line in my .h (outside my class definiton) file which is:
const int Alpgen::Sample; (because it is a static data member!!) [/quote]You MUST add this line to your .cc file and NOT to your .h file. The compiler must see that line exactly once.