Dear Rooters
I am just trying to convert my program from MacOS X and Linux to VC++ and get many unexpected compilation errors.
Some errors are annoying but easy to solve, for others I would appreciate any help.
- Here is the first problem where I need help. I have the following code fragment:
char strg[128];
tree->Branch("strg", strg, "strg[128]/C");
and get the following error:
XPSData.cxx(3440) : error C2666: 'TTree::Branch' : 2 overloads have similar conversions
c:\root\include\TTree.h(207): could be 'TBranch *TTree::Branch(const char *,const char *,void *,Int_t,Int_t)'
c:\root\include\TTree.h(205): or 'TBranch *TTree::Branch(const char *,void *,const char *,Int_t)'
while trying to match the argument list '(const char [5], char [128], const char [12])'
How can I solve this problem?
- At many places I have the following code fragments to avoid warnings from gcc:
virtual Double_t GetValue(const char */*name*/) {return 0;}
Sadly, this results in the following warning with VC++:
c:\home\rabbitus\rootcode\xps\XPSBase.h(210) : warning C4138: '*/' found outside of comment
Is there a solution which avoids warnings in both gcc and VC++?
- Here are some code fragments resulting in compilation errors, which I could solve:
char *pos = strchr(name,sep);
// must be changed to:
char *pos = strchr((char*)name,sep);
char *s = (char*)(name.Data());
*s = std::toupper(s[0]);
// must be changed to:
*s = toupper(s[0]);
Does MS VC++ not follow the C++ standard or is this my mistake?
Thank you in advance.
Best regards
Christian