Compilation error using RooFit

Hi,

while compiling my code with root6 I experience the following error. Using v5.34.10 everything works smoothly. I’d appreciate a hint.

Thanks and regards,
Kirill

Building file: ../corrector.cc Invoking: Cross G++ Compiler clang++ -I/Users/klapidus/actual_root/include -I/usr/include -O2 -g3 -c -fmessage-length=0 -stdlib=libc++ -m64 -MMD -MP -MF"corrector.d" -MT"corrector.d" -o "corrector.o" "../corrector.cc" In file included from ../corrector.cc:8: In file included from ../corrector.h:14: In file included from ../histogrammer.h:16: ../functions.h:150:1: warning: control may reach end of non-void function [-Wreturn-type] } ^ In file included from ../corrector.cc:8: In file included from ../corrector.h:25: In file included from /Users/klapidus/actual_root/include/RooRealVar.h:26: In file included from /Users/klapidus/actual_root/include/RooAbsRealLValue.h:24: In file included from /Users/klapidus/actual_root/include/RooAbsReal.h:22: /Users/klapidus/actual_root/include/RooArgSet.h:34:47: error: expected ';' at end of declaration list void* operator new (size_t bytes, void* ptr) noexcept; ^ ; 1 warning and 1 error generated. make: *** [corrector.o] Error 1

Hi Kirill,

noexcept is a feature of C++11
en.cppreference.com/w/cpp/language/noexcept_spec

to compile your code, you have to add the -std=c++11 flag. One way to do this in a forward scalable manner, would be to add to the line root-config --cflags: this automatically propagates the flags which were used to compile root.

Cheers,
Danilo

Thanks, this solved the issue.