You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TMVA headers must be included before TODBCServer.h to avoid compile error in TVirtualTreePlayer.h(45,75): error C2589: '(': illegal token on right side of '::'
#16638
My Windows 11 program compiles and runs when the '#include "TMVA/Factory.h"' statement precedes the '#include "TODBCResult.h"' statement, and fails to compile as below when the order is reversed:
1>------ Build started: Project: RootGrapher, Configuration: Debug x64 ------
1>RootGrapher.cpp
1>E:\dev\root_build\include\TArrayL64.h(45,61): warning C4244: 'return': conversion from 'Long64_t' to 'Double_t', possible loss of data
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,75): warning C4003: not enough arguments for function-like macro invocation 'max'
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,75): error C2589: '(': illegal token on right side of '::'
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,44): error C2062: type 'unknown-type' unexpected
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,42): error C2789: 'TVirtualTreePlayer::kMaxEntries': an object of const-qualified type must be initialized
1>(compiling source file 'RootGrapher.cpp')
1> E:\dev\root_build\include\TVirtualTreePlayer.h(45,30):
1> see declaration of 'TVirtualTreePlayer::kMaxEntries'
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,75): error C2059: syntax error: ')'
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TTree.h(229,64): error C2131: expression did not evaluate to a constant
1>(compiling source file 'RootGrapher.cpp')
1> E:\dev\root_build\include\TTree.h(229,64):
1> failure was caused by a read of an uninitialized symbol
1> E:\dev\root_build\include\TTree.h(229,64):
1> see usage of 'kMaxEntries'
Reproducer
put this in a cpp file and compile it to see the error:
#include "TODBCServer.h"
// TMVA seems to compile only when before TODBCServer.h
#include "TMVA/Factory.h"
ROOT version
| Welcome to ROOT 6.32.06 https://root.cern |
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for win64 on Oct 07 2024, 17:23:18 |
| From tags/6-32-06@6-32-06 |
| With MSVC 19.41.34120.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
Welcome to the ROOT tutorials
Type ".x demos.C" to get a toolbar from which to execute the demos
Type ".x demoshelp.C" to see the help window
==> Many tutorials use the file hsimple.root produced by hsimple.C
==> It is recommended to execute hsimple.C before any other script
Taking a break from ROOT? Hope to see you back!
Installation method
N/A
Operating system
Windows 11
Additional context
No response
The text was updated successfully, but these errors were encountered:
Check duplicate issues.
Description
My Windows 11 program compiles and runs when the '#include "TMVA/Factory.h"' statement precedes the '#include "TODBCResult.h"' statement, and fails to compile as below when the order is reversed:
1>------ Build started: Project: RootGrapher, Configuration: Debug x64 ------
1>RootGrapher.cpp
1>E:\dev\root_build\include\TArrayL64.h(45,61): warning C4244: 'return': conversion from 'Long64_t' to 'Double_t', possible loss of data
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,75): warning C4003: not enough arguments for function-like macro invocation 'max'
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,75): error C2589: '(': illegal token on right side of '::'
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,44): error C2062: type 'unknown-type' unexpected
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,42): error C2789: 'TVirtualTreePlayer::kMaxEntries': an object of const-qualified type must be initialized
1>(compiling source file 'RootGrapher.cpp')
1> E:\dev\root_build\include\TVirtualTreePlayer.h(45,30):
1> see declaration of 'TVirtualTreePlayer::kMaxEntries'
1>E:\dev\root_build\include\TVirtualTreePlayer.h(45,75): error C2059: syntax error: ')'
1>(compiling source file 'RootGrapher.cpp')
1>E:\dev\root_build\include\TTree.h(229,64): error C2131: expression did not evaluate to a constant
1>(compiling source file 'RootGrapher.cpp')
1> E:\dev\root_build\include\TTree.h(229,64):
1> failure was caused by a read of an uninitialized symbol
1> E:\dev\root_build\include\TTree.h(229,64):
1> see usage of 'kMaxEntries'
Reproducer
put this in a cpp file and compile it to see the error:
#include
#include <gsl\gsl>
#include "TF1.h"
#include "TH1F.h"
#include "TApplication.h"
#include <TAxis.h>
#include "TCanvas.h"
#include "TDatime.h"
#include "TFrame.h"
#include "TGraph.h"
#include "TMultiGraph.h"
#include "TRootCanvas.h"
#include "TODBCServer.h"
// TMVA seems to compile only when before TODBCServer.h
#include "TMVA/Factory.h"
ROOT version
| Welcome to ROOT 6.32.06 https://root.cern |
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for win64 on Oct 07 2024, 17:23:18 |
| From tags/6-32-06@6-32-06 |
| With MSVC 19.41.34120.0 |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
Welcome to the ROOT tutorials
Type ".x demos.C" to get a toolbar from which to execute the demos
Type ".x demoshelp.C" to see the help window
==> Many tutorials use the file hsimple.root produced by hsimple.C
==> It is recommended to execute hsimple.C before any other script
Taking a break from ROOT? Hope to see you back!
Installation method
N/A
Operating system
Windows 11
Additional context
No response
The text was updated successfully, but these errors were encountered: