Roofit in ACLIC compiler

If I try and run the code:

#include "TFile.h"
#include "TH1.h"
#include "RooFit.h"

using namespace std;

void TFFitter(){
  RooRealVar x("x", "x", 0., 1.0);
}

I get:

root [2] .L tffitter_test.c+ Info in <TUnixSystem::ACLiC>: creating shared library /home/jmorris/docs/research/Banalysis/./tffitter_test_c.so Error in <ACLiC>: Dictionary generation failed! Info in <ACLiC>: Invoking compiler to check macro's validity /home/jmorris/docs/research/Banalysis/./tffitter_test.c: In function 'void TFFitter()': /home/jmorris/docs/research/Banalysis/./tffitter_test.c:9: error: 'RooRealVar' was not declared in this scope /home/jmorris/docs/research/Banalysis/./tffitter_test.c:9: error: expected `;' before 'x'

I’ve tried changing my namespace to RooFit. Roofit libraries are loaded at start of root5 (with rootlogon.C). I am only looking for one example of using roofit executed this way with c-compiled code. Does anyone have an example.

Thank you!
James

The error message means that the Roofit library was not loaded.
Could you do a
gSystem->Load(“libRoofit”);
before using ACLIC on your script?

Rene