Open vgvassilev opened 2 years ago
Usually the syntax is
rootcling -f mydict.cxx -rmf libmydict.rootmap -rml libmydict.so TwoInts.h LinkDef.h
If we can't call rootcling
without passing a header file next to the linkdef, we might be able diagnose this with the recent argument parsing implementation.
@pcanal - thanks, but adding the header to the command line still does not work if that header does not include:
#ifndef TwoInts_h
#define TwoInts_h
//#include <ROOT/RDataFrame.hxx>
//#include <ROOT/RVec.hxx>
//
//using namespace ROOT::VecOps;
struct TwoInts {
int a, b;
};
#endif /* TwoInts_h */
% rootcling -f mydict.cxx -rmf libmydict.rootmap -rml libmydict.so TwoInts.h LinkDef.h
yana@iannas-macbook-pro AK-RDF % clang++ -mmacosx-version-min=11.6 -shared -o libmydict.so mydict.cxx `root-config --cflags --libs`
mydict.cxx:56:70: error: no member named 'VecOps' in namespace 'ROOT'
static TGenericClassInfo *GenerateInitInstanceLocal(const ::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> >*)
~~~~~~~~^
mydict.cxx:56:89: error: no member named 'VecOps' in namespace 'ROOT'
static TGenericClassInfo *GenerateInitInstanceLocal(const ::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> >*)
~~~~~~^
mydict.cxx:56:105: error: expected '(' for function-style cast or type construction
static TGenericClassInfo *GenerateInitInstanceLocal(const ::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> >*)
~~~^
mydict.cxx:56:107: error: expected ')'
static TGenericClassInfo *GenerateInitInstanceLocal(const ::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> >*)
^
mydict.cxx:56:55: note: to match this '('
static TGenericClassInfo *GenerateInitInstanceLocal(const ::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> >*)
^
mydict.cxx:58:15: error: no member named 'VecOps' in namespace 'ROOT'
::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> > *ptr = 0;
~~~~~~~~^
mydict.cxx:58:34: error: no member named 'VecOps' in namespace 'ROOT'
::ROOT::VecOps::RVec<ROOT::VecOps::RVec<int> > *ptr = 0;
~~~~~~^
...
cat LinkDef.h:
TwoInts.h:
ROOT version 6.24/06
The second command would fail with an error: no member named 'VecOps' in namespace ‘ROOT’ if LinkDef.h has includes, but TwoInts.h does not.
Is that a feature or a bug?
cc: @ianna