Compiling custom class with g++

Hello,

     I'm trying to compile my code with custom classes in g++. The classes work if I use CINT. I just use 

and I can use them, however when I try to compile using g++ with the same commands and making sure the header file is imported in the actual program, I get:

Undefined symbols for architecture x86_64: "U235FluxPull::U235FluxPull(char const*, char const*, RooAbsReal&, RooAbsReal&, RooAbsReal&, RooAbsReal&, RooAbsReal&, RooAbsReal&)", referenced from: LogLikelihood(double const*) in Prime.o "U238FluxPull::U238FluxPull(char const*, char const*, RooAbsReal&, RooAbsReal&, RooAbsReal&, RooAbsReal&, RooAbsReal&, RooAbsReal&)", referenced from: LogLikelihood(double const*) in Prime.o

My makefile looks like:

[code]R_LDFLAGS = root-config --ldflags
R_LIBS = root-config --libs
R_CFLAGS = root-config --cflags
R_GRAPHICS = root-config --glibs
R_ALL = $(R_LADFLAGS) $(R_LIBS) $(R_CFLAGS) $(R_GRAPHICS)

Project: Prime.C
g++ -Wall -fPIC $(R_ALL) -L $(ROOTSYS)/lib -lRooFitCore -lRooFit -lMinuit -D_GLIBCXX_PARALLEL -fopenmp -c -o Prime.o Prime.C
g++ -W -Wall $(R_ALL) -L $(ROOTSYS)/lib -lRooFitCore -lRooFit -lMinuit -lGui -D_GLIBCXX_PARALLEL -fopenmp Prime.o -o Prime
[/code]

Thank you

I forgot to add this other error message:

"vtable for U235FluxPull", referenced from: U235FluxPull::~U235FluxPull() in Prime.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.

and the header file:

[code]/*****************************************************************************

  • Project: RooFit *
  •                                                                       *
    
  • This code was autogenerated by RooClassFactory *
    *****************************************************************************/

#ifndef U235FLUXPULL
#define U235FLUXPULL

#include “RooAbsReal.h”
#include “RooRealProxy.h”
#include “RooCategoryProxy.h”
#include “RooAbsReal.h”
#include “RooAbsCategory.h”

class U235FluxPull : public RooAbsReal {
public:
U235FluxPull() {} ;
U235FluxPull(const char name, const char title,
RooAbsReal& _C0,
RooAbsReal& _C1,
RooAbsReal& _C2,
RooAbsReal& _C3,
RooAbsReal& _C4,
RooAbsReal& _C5);
U235FluxPull(const U235FluxPull& other, const char
name=0) ;
virtual TObject
clone(const char* newname) const { return new U235FluxPull(*this,newname); }
inline virtual ~U235FluxPull() { }

protected:

RooRealProxy C0 ;
RooRealProxy C1 ;
RooRealProxy C2 ;
RooRealProxy C3 ;
RooRealProxy C4 ;
RooRealProxy C5 ;

Double_t evaluate() const ;

private:

ClassDef(U235FluxPull,1) // Your description goes here…
};

#endif
[/code]

and the relevant part of the cxx file:

[code]/*****************************************************************************

  • Project: RooFit *
  •                                                                       * 
    
  • This code was autogenerated by RooClassFactory *
    *****************************************************************************/

// Your description goes here…

#include “Riostream.h”

#include “U235FluxPull.h”
#include “RooAbsReal.h”
#include “RooAbsCategory.h”
#include <math.h>
#include “TMath.h”
#include “TMatrixD.h”

ClassImp(U235FluxPull)

U235FluxPull::U235FluxPull(const char *name, const char *title,
RooAbsReal& _C0,
RooAbsReal& _C1,
RooAbsReal& _C2,
RooAbsReal& _C3,
RooAbsReal& _C4,
RooAbsReal& _C5) :
RooAbsReal(name,title),
C0(“C0”,“C0”,this,_C0),
C1(“C1”,“C1”,this,_C1),
C2(“C2”,“C2”,this,_C2),
C3(“C3”,“C3”,this,_C3),
C4(“C4”,“C4”,this,_C4),
C5(“C5”,“C5”,this,_C5)
{
}

U235FluxPull::U235FluxPull(const U235FluxPull& other, const char* name) :
RooAbsReal(other,name),
C0(“C0”,this,other.C0),
C1(“C1”,this,other.C1),
C2(“C2”,this,other.C2),
C3(“C3”,this,other.C3),
C4(“C4”,this,other.C4),
C5(“C5”,this,other.C5)
{
}

Double_t U235FluxPull::evaluate() const
{ …}[/code]