Hi there,
I have a macro which runs fine on my Linux machine (running Root 6.12), but the same macro won’t run on my Windows laptop, stating multiple errors at the first few lines defining a custom class which I modified from a tutorial.
I’ve only just put Root on this device, and it always starts with multiple errors, but from the little testing I’ve done this doesn’t seem to have affected the functionality.
Is there a change between 6.12 and 6.14 that could have caused this?
class file {
public:
Double_t t;
Double_t v;
};
class Event: public TObject {
public:
file f;
ClassDef(Event,1)
};
ClassImp(Event)
Error:
In file included from input_line_19:1:
In file included from \\[filepath]\root\R1R2_3.0.1.C:28:
C:\root_v6.14.00\include\ROOT/TDataFrame.hxx:20:2: warning: The TDataFrame.hxx header has been replaced by RDataFrame.hxx [-W#warnings]
#warning The TDataFrame.hxx header has been replaced by RDataFrame.hxx
^
In file included from input_line_19:1:
\\[filepath]\root\R1R2_3.0.1.C:44:18: error: expected parameter declarator
ClassDef(Event,1)
^
\\[filepath]\root\R1R2_3.0.1.C:44:18: error: expected ')'
\\[filepath]\root\R1R2_3.0.1.C:44:3: note: to match this '('
ClassDef(Event,1)
^
libCore dictionary payload:205:17: note: expanded from macro 'ClassDef'
_ClassDefInterp_(name,id,virtual,) \
^
In file included from input_line_19:1:
\\[filepath]\root\R1R2_3.0.1.C:44:3: error: C++ requires a type specifier for all declarations
ClassDef(Event,1)
^
libCore dictionary payload:204:28: note: expanded from macro 'ClassDef'
#define ClassDef(name, id) \
^
In file included from input_line_19:1:
\\[filepath]\root\R1R2_3.0.1.C:44:3: error: expected ';' at end of declaration list
libCore dictionary payload:205:36: note: expanded from macro 'ClassDef'
_ClassDefInterp_(name,id,virtual,) \
^
In file included from input_line_19:1:
\\[filepath]\root\R1R2_3.0.1.C:70:10: error: no matching constructor for initialization of 'std::ofstream' (aka 'basic_ofstream<char,
char_traits<char> >')
ofstream textmaker;
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:1011:12: note: candidate constructor template not viable: requires at least argument '_Path', but no arguments were
provided
explicit basic_ofstream(const _Identity_t<_Path_ish>& _Path,
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:1029:11: note: candidate constructor not viable: requires single argument '_File', but no arguments were provided
explicit basic_ofstream(_Filet *_File)
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:1035:2: note: candidate constructor not viable: requires single argument '_Right', but no arguments were provided
basic_ofstream(_Myt&& _Right)
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:1065:2: note: candidate constructor not viable: requires 1 argument, but 0 were provided
basic_ofstream(const _Myt&) = delete;
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:978:11: note: candidate constructor not viable: requires at least argument '_Filename', but no arguments were
provided
explicit basic_ofstream(const char *_Filename,
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:987:11: note: candidate constructor not viable: requires at least argument '_Str', but no arguments were provided
explicit basic_ofstream(const string& _Str,
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:994:11: note: candidate constructor not viable: requires at least argument '_Filename', but no arguments were
provided
explicit basic_ofstream(const wchar_t *_Filename,
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:1003:11: note: candidate constructor not viable: requires at least argument '_Str', but no arguments were provided
explicit basic_ofstream(const wstring& _Str,
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\fstream:1019:11: note: candidate constructor not viable: requires at least argument '_Filename', but no arguments were
provided
explicit basic_ofstream(const unsigned short *_Filename,
^
In file included from input_line_19:1:
\\[filepath]\root\R1R2_3.0.1.C:246:14: error: no matching constructor for initialization of 'std::stringstream' (aka 'basic_stringstream<char,
char_traits<char>, allocator<char> >')
stringstream ss(path);
^ ~~~~
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\sstream:589:11: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'ios_base::openmode' (aka 'int') for 1st argument
explicit basic_stringstream(ios_base::openmode _Mode =
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\sstream:603:2: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'std::basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >::_Myt' (aka 'basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >') for 1st argument
basic_stringstream(_Myt&& _Right)
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\sstream:633:2: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'const std::basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >::_Myt' (aka 'const basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >') for 1st argument
basic_stringstream(const _Myt&) = delete;
^
In file included from input_line_19:1:
\\[filepath]\root\R1R2_3.0.1.C:250:14: error: no matching constructor for initialization of 'std::stringstream' (aka 'basic_stringstream<char,
char_traits<char>, allocator<char> >')
stringstream ss_(fname);
^ ~~~~~
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\sstream:589:11: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'ios_base::openmode' (aka 'int') for 1st argument
explicit basic_stringstream(ios_base::openmode _Mode =
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\sstream:603:2: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'std::basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >::_Myt' (aka 'basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >') for 1st argument
basic_stringstream(_Myt&& _Right)
^
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\sstream:633:2: note: candidate constructor not viable: no known conversion from 'std::string' (aka 'basic_string<char,
char_traits<char>, allocator<char> >') to 'const std::basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >::_Myt' (aka 'const basic_stringstream<char,
std::char_traits<char>, std::allocator<char> >') for 1st argument
basic_stringstream(const _Myt&) = delete;
^
Start-up error:
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegQueryValueEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
RegOpenKeyEx: returned 2: The system cannot find the file specified.
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\cassert:4:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\corecrt.h:131:12: error: redefinition of '_CrtEnableIf<true, _Ty>'
struct _CrtEnableIf<true, _Ty>
^~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt\corecrt.h:131:12: note: previous definition is here
struct _CrtEnableIf<true, _Ty>
^
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\cassert:4:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\corecrt.h:488:16: error: redefinition of '__crt_locale_data_public'
typedef struct __crt_locale_data_public
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt\corecrt.h:488:16: note: previous definition is here
typedef struct __crt_locale_data_public
^
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\cassert:4:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\corecrt.h:495:16: error: redefinition of '__crt_locale_pointers'
typedef struct __crt_locale_pointers
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt\corecrt.h:495:16: note: previous definition is here
typedef struct __crt_locale_pointers
^
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\cassert:4:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\corecrt.h:503:16: error: redefinition of '_Mbstatet'
typedef struct _Mbstatet
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt\corecrt.h:503:16: note: previous definition is here
typedef struct _Mbstatet
^
------------------------------------------------------------
| Welcome to ROOT 6.14/00 http://root.cern.ch |
| (c) 1995-2018, The ROOT Team |
| Built for win32 |
| From tag v6-14-00, 13 June 2018 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0]
Thanks in advance,
Alistair
_ROOT Version: 6.14
_Platform: Windows 10 Pro
Compiler: Not Provided