root-project/cling

Compiling Cling returns DeclUnloader.cpp error

TaiXeflar opened this issue · 2 comments

I'm compile Cling with source on Windows 11 platform with Visual Studio 2022 and have these problem in final process:

C:\Cling\cling-src\tools\cling\lib\Interpreter\DeclUnloader.cpp(1031): error C2039: 'loaded_spec_begin': 並非 'clang::FunctionTemplateDecl' 的成員
C:\Cling\cling-src\tools\clang\include\clang/Sema/Sema.h(136): note: 請參閱 'clang::FunctionTemplateDecl' 的宣告
C:\Cling\cling-src\tools\cling\lib\Interpreter\DeclUnloader.cpp(1032): error C2039: 'loaded_spec_end': 並非 'clang::FunctionTemplateDecl' 的成員
C:\Cling\cling-src\tools\clang\include\clang/Sema/Sema.h(136): note: 請參閱 'clang::FunctionTemplateDecl' 的宣告
C:\Cling\cling-src\tools\cling\lib\Interpreter\DeclUnloader.cpp(1044): error C2039: 'loaded_spec_begin': 並非 'clang::ClassTemplateDecl' 的成員
C:\Cling\cling-src\tools\clang\include\clang/Sema/Sema.h(110): note: 請參閱 'clang::ClassTemplateDecl' 的宣告
C:\Cling\cling-src\tools\cling\lib\Interpreter\DeclUnloader.cpp(1045): error C2039: 'loaded_spec_end': 並非 'clang::ClassTemplateDecl' 的成員
C:\Cling\cling-src\tools\clang\include\clang/Sema/Sema.h(110): note: 請參閱 'clang::ClassTemplateDecl' 的宣告

I'm sure the source is from http://root.cern.ch/git/ by using "cpt.py" Python script console. But no matter using default NMAKE or by command line with Ninja as generator, I always stuck at this DeclUnloader.cpp error. Is there any manual fixes or new source release can change?

I had the same issue. I modified DeclUnloader.cpp by replacing loaded_spec_begin with spec_begin and loaded_spec_end with spec_end and it compiled fine.

@chribell Thanks a lot! It actually works wery well.