DRAGON-Collaboration / analyzer

DRAGON analysis codes
http://dragon-collaboration.github.io/analyzer/
4 stars 5 forks source link

Compilation Error #4

Open padsley opened 4 years ago

padsley commented 4 years ago

With ROOT 6:

/tmp/mid2root-70fc71.o: In function `m2r::process_args(int, char**, m2r::Options_t*)':
src/mid2root.cxx:(.text+0x9de): undefined reference to `TString::TString(std::string const&)'

It looks like that way of defining a TString might not exist in more modern ROOT versions:

root [0] TString *string = new TString(
TString TString()   // Null string
TString TString(Ssiz_t ic)  // Suggested capacity
TString TString(TString&& s)    // Move constructor
TString TString(char c)
TString TString(char c, Ssiz_t s)
TString TString(const TString& s)   // Copy constructor
TString TString(const TSubString& sub)
TString TString(const char* s)  // Copy to embedded null
TString TString(const char* s, Ssiz_t n)    // Copy past any embedded nulls
TString TString(const string& s)
TString TString(const string_view& sub)

I'm going to try a fix for it.

padsley commented 4 years ago

My fix (which fixed the first problem in m2r::process_args) was to change the line:

what += *iarg; what += "\'"; at 287 in mid2root.cxx to

what += iarg->c_str(); what += "\'";

This seemed to fix the problem.

However, there are now errors of the form:

/home/padsley/codes/dragon/lib/libDragon.so: undefined reference to `TString::TString(std::string const&)'
/home/padsley/codes/dragon/lib/libDragon.so: undefined reference to `TROOT::RegisterModule(char const*, char const**, char const**, char const*, char const*, void (*)(), std::vector<std::pair<std::string, int>, std::allocator<std::pair<std::string, int> > > const&, char const**, bool)'

The first one of these is another failed TString assignment, I think. I can't currently find it amongst the various input files to libDragon.so, however.

The TROOT::RegisterModule error is likely due too the changed method for declaration of these objects. Acceptable methods are apparently:

root [0] TROOT::RegisterModule(
void RegisterModule(const char* modulename, const char** headers, const char** includePaths, const char* payLoadCode, const char* fwdDeclCode, void(*)() triggerFunc, const TROOT::FwdDeclArgsToKeepCollection_t& fwdDeclsArgToSkip, const char** classesHeaders, bool hasCxxModule = false)
padsley commented 4 years ago

(I'm like 90% sure that these problems are due to my having ROOT6 but changing ROOT versions is problematic as i need some ROOT6 functionality for K600 analysis.)