I have a .hh file
#ifndef _testdef_hh_
#define _testdef_hh_
namespace testdef
{
//extern const int testi;
void testDo();
}
void someDo();
#endif
.cc file
#include "testdef.hh"
#include <stdio.h>
//NamespaceImp(testdef)
//const int testdef::testi = 5;
void testdef::testDo()
{
printf("Hi! I am testdef::testDo()\n");
}
void someDo()
{
printf("Hi! I am someDo()\n");
}
and a linkdef file
/
/ some C++ header definition
#ifdef __MAKECINT__
// turns off dictionary generation for all
#pragma link off all class;
#pragma link off all function;
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link off all namespaces;
#pragma link C++ namespace testdef;
//#pragma link C++ const int testdef::testi;
#pragma link C++ function testdef::testDo();
#pragma link C++ function someDo();
#endif
In cling
root -l
executing /afs/cern.ch/work/v/vveckaln/private/CMSSW_9_4_11/src/TopLJets2015/TopAnalysis/rootlogon.C
root [0] testdef::testDo()
ROOT_prompt_0:1:1: error: 'testdef' is not a class, namespace, or enumeration
testdef::testDo()
^
ROOT_prompt_0:1:1: note: 'testdef' declared here
root [1] someDo()
Hi! I am someDo()
root [2] testdef::testDo()
Hi! I am testdef::testDo()
one sees that calling someDo()
wakes up testdef::testDo()
. Where is the bug?
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided