-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linker error VS 2017 build on Windows #399
Comments
Did you used the llvm[1] and clang[2] repositories from [1] http://root.cern/git/llvm.git |
(sorry for the delay. Answered first on the notification email and this is not forwarded here) yes, Simon, I followed the instructions on the official sites and the root forum. For safety the git configs below. There is a weired directory: src/tools/cling/.github No idea where it comes from. After some reading there come up the following ideas:
Good ideas ? Here the git configs: src.git: [remote "origin"] src\tools\clang: [remote "origin"] src/tools/cling: [remote "origin"] |
The
Executing the VCvars*.bat file before cmake is important. Are you by any chance using Ninja? Cling cannot be built on Windows using the Ninja generator as of now. |
@reikdas Thanks for helping. I can give only basic support on Windows, because I'm developing on Linux. |
thanks for the replies. We don't use ninja for good reasons. cmake is normally not depending on the vcvars*.bat/cmd file for setting environment variables. It detects the toolchains normally by itsself. Also on Windows. Anyway. We will iterate through the options of my last and @reikdas comments. |
visual studio 2017 updated, vcvarsx86_amd64.cmd used, cmake 3.15.0, Got the same error. What I found now for the cling.exe project. The linker get's additional options with 2 export advices and it can't find it within cling.exe: /EXPORT:?getAsString@QualType@clang@@SA?AV?"$"basic_string@DU?"$"char_traits@D@std@@V?"$"allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@Z /EXPORT:?handle@raw_ostream@llvm@@EEAAXXZ I searched the sources for any clang::QualType::getAsString(class clang::Type const *,class clang::Qualifiers) . I didn't find a version that would fit with 2 parameters. I found in the cmakelists.txt a hint that cling shall export additional symbols, but I didn't find where this is defined. When I remove the above /EXPORT commands it links now, but .... This should not happen. |
finally I found the reason for the error. I can change this by myself, but this is definitely a bug and hard stuff - so to say. Who is maintaining this ? |
I replaced the export symbol command as shown below. Links fine. I give up for the moment, because this needs more digging and without code knowledge this takes too much time. /EXPORT:?getAsString@QualType@clang@@SA?AV?"$"basic_string@DU?"$"char_traits@D@std@@V?"$"allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@Z ---> /EXPORT:?getAsString@QualType@clang@@QEBA?AV?"$"basic_string@DU?"$"char_traits@D@std@@V?"$"allocator@D@2@@std@@AEBUPrintingPolicy@2@@Z /EXPORT:??6raw_ostream@llvm@@QEAAAEAV01@PEBX@Z ---> /EXPORT:??6raw_ostream@llvm@@QEAAAEAV01@PEBD@Z printout of call stack (?) cling.exe on exit [cling]$ #include [cling]$ using namespace std ; [cling]$ cout << 1234 << end ; ... --> forgot the "l" and a lot of errors come now then quit ... [cling]$ .q 0x00007FF6CD640B1A (0x000001C274F3F2B0 0x000001C200000000 0x000000000000007F 0x00007FFB88BB9F66), ?getAsStringInternal@QualType@clang@@SAXPEBVType@2@VQualifiers@2@AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBUPrintingPolicy@2@@Z() + 0x1B246AA bytes(s) 0x00007FFB88BB9D26 (0x0000002E8758F800 0x0000002E8758F858 0x0000002E8758F8F0 0x00007FFB88C8BC20), _execute_onexit_table() + 0x156 bytes(s) 0x00007FFB88BB9C4B (0x0000002E8758F8D8 0x00007FFB88C8BC20 0x000000003F800000 0x0000002E8758F848), _execute_onexit_table() + 0x7B bytes(s) 0x00007FFB88BB9C04 (0x00007FFB88C8C038 0x00007FFB00000002 0x0000000000000002 0x0000002E8758F840), _execute_onexit_table() + 0x34 bytes(s) 0x00007FFB88BB87D2 (0x0000000000000000 0x0000002E8758F8F0 0x0000000000000000 0x0000000000000000), exit() + 0x142 bytes(s) 0x00007FFB88BB875B (0x0000000000000000 0x0000000000000000 0x000001C274F3AAD0 0x0000002E8758F8D0), exit() + 0xCB bytes(s) 0x00007FFB88BB86FE (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), exit() + 0x6E bytes(s) 0x00007FF6CD641E6F (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), ??_U@YAPEAX_K@Z() + 0x4FB bytes(s) 0x00007FFB892A7C24 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s) 0x00007FFB8AF0D721 (0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s) |
@ivti Do you use the latest dev branch from yesterday? Axel fixed a segmentation fault at exiting cling. I'm not sure, if this is the same error, but could be. |
updated and compiled cling with Axel Naumanns last commit. |
@ivti I already feared it, because of the symbol name in the error message. But it was a cheap try ;-) |
I found now that since 2017 these Export sections for cling.exe in src\tools\cling\tools\driver\CMakeLists.txt were not touched anymore while llvm and cling proceed. Bertran Bellnot and Frederich Munch were involved. It would be nice to learn why these exports and which are required. |
@bellenot can you help us with this problem? |
I'll take a look |
@ivti do you compile cling in 64 bit or 32 bit mode? |
@bellenot 64bit ! |
Can you try to remove those two lines from
And BTW, @vgvassilev , it looks like the patch for |
@bellenot thanks for the patch. I will try it later as I am in another project now. |
@bellenot I just uploaded the patched CMakeLists.txt as patch was a bit moaning about it. But seems to be correct. |
@ivti thanks, I'll submit a PR |
Resolves root-project/cling#399 Fix the following linker errors: 253>cling.exp : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl clang::QualType::getAsString(class clang::Type const *,class clang::Qualifiers)" (?getAsString@QualType@clang@@sa?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@z) 253>cling.exp : error LNK2001: unresolved external symbol "private: virtual void __cdecl llvm::raw_ostream::handle(void)" (?handle@raw_ostream@llvm@@EEAAXXZ) 253>D:\work\libs\cling\src\build\Release\bin\cling.exe : fatal error LNK1120: 2 unresolved externals
@bellenot I have not tested it! Sorry for the "seems to be correct". |
Can you test it? It works for me with the latest version of VS 2019 |
@bellenot Huuh. Here we go. I am using still VS 2017. The minimum version required is VS 2017 with all updates, as I found it in CMake version hints. Also for Clang - on the website - Link from Axel Naumann. If VS 2019 is required then this should be at a minimum in the driver CMake files with this extra exports. |
Resolves root-project/cling#399 Fix the following linker errors: 253>cling.exp : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl clang::QualType::getAsString(class clang::Type const *,class clang::Qualifiers)" (?getAsString@QualType@clang@@sa?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@z) 253>cling.exp : error LNK2001: unresolved external symbol "private: virtual void __cdecl llvm::raw_ostream::handle(void)" (?handle@raw_ostream@llvm@@EEAAXXZ) 253>D:\work\libs\cling\src\build\Release\bin\cling.exe : fatal error LNK1120: 2 unresolved externals
Resolves #399 Fix the following linker errors: 253>cling.exp : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl clang::QualType::getAsString(class clang::Type const *,class clang::Qualifiers)" (?getAsString@QualType@clang@@sa?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@z) 253>cling.exp : error LNK2001: unresolved external symbol "private: virtual void __cdecl llvm::raw_ostream::handle(void)" (?handle@raw_ostream@llvm@@EEAAXXZ) 253>D:\work\libs\cling\src\build\Release\bin\cling.exe : fatal error LNK1120: 2 unresolved externals
@ivti Visual Studio 2019 is the minimal required version for ROOT, and I don't know if it's the same for Cling. Please try and let us know. And those symbols have to be exported to be somehow visible by the Jit. This should not be necessary and will be fixed in the future, hopefully. |
@bellenot I will test first 2017 and then 2019 using the buildtools. Hopefully this week. |
Thanks. 2019 is fine, I tested it. I just want to know about 2017 |
@bellenot first of all: good news it is build without linker errors with VS 2017 ! But when I run my little test, there is still a crash after ".q". See below. D:\work\libs\cling\src\build\Release\bin>cling ****************** CLING ****************** * Type C++ code and press enter to run it * * Type .q to exit * ******************************************* [cling]$ #include '<'iostream'>' [cling]$ using namespace std; [cling]$ cout << "test" << endl ; test [cling]$ cout << "test" << enl ; input_line_6:2:20: error: use of undeclared identifier 'enl'; did you mean 'endl'? cout << "test" << enl ; ^~~ endl C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\ostream:1018:22: note: 'endl' declared here __CLRCALL_OR_CDECL endl(basic_ostream<_Elem, _Traits>& _Ostr) ^ [cling]$ .q #0 0x00007ff76eb70d0a clang::QualType::getAsStringInternal(class clang::Type const *,class clang::Qualifiers,class std::basic_string,class std::allocator > &,struct clang::PrintingPolicy const &) (D:\work\libs\cling\src\build\Release\bin\cling.exe+0x2d30d0a) #1 0x00007ffb6b749d26 (C:\WINDOWS\System32\ucrtbase.dll+0x19d26) #2 0x00007ffb6b749c4b (C:\WINDOWS\System32\ucrtbase.dll+0x19c4b) #3 0x00007ffb6b749c04 (C:\WINDOWS\System32\ucrtbase.dll+0x19c04) #4 0x00007ffb6b7487d2 (C:\WINDOWS\System32\ucrtbase.dll+0x187d2) #5 0x00007ffb6b74875b (C:\WINDOWS\System32\ucrtbase.dll+0x1875b) #6 0x00007ffb6b7486fe (C:\WINDOWS\System32\ucrtbase.dll+0x186fe) #7 0x00007ff76eb7205f operator new[](unsigned __int64) (D:\work\libs\cling\src\build\Release\bin\cling.exe+0x2d3205f) #8 0x00007ffb6dce7c24 (C:\WINDOWS\System32\KERNEL32.DLL+0x17c24) #9 0x00007ffb6e82d721 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6d721) |
Replacing |
@bellenot first of all: good news it is build without linker errors with VS 2017 ! But when I run my little test, there is still a crash after ".q". See below. D:\work\libs\cling\src\build\Release\bin>cling ****************** CLING ****************** * Type C++ code and press enter to run it * * Type .q to exit * ******************************************* [cling]$ #include '<'iostream'>' [cling]$ using namespace std; [cling]$ cout << "test" << endl ; test [cling]$ cout << "test" << enl ; input_line_6:2:20: error: use of undeclared identifier 'enl'; did you mean 'endl'? cout << "test" << enl ; ^~~ endl C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\ostream:1018:22: note: 'endl' declared here __CLRCALL_OR_CDECL endl(basic_ostream<_Elem, _Traits>& _Ostr) ^ [cling]$ .q #0 0x00007ff76eb70d0a clang::QualType::getAsStringInternal(class clang::Type const *,class clang::Qualifiers,class std::basic_string,class std::allocator > &,struct clang::PrintingPolicy const &) (D:\work\libs\cling\src\build\Release\bin\cling.exe+0x2d30d0a) #1 0x00007ffb6b749d26 (C:\WINDOWS\System32\ucrtbase.dll+0x19d26) #2 0x00007ffb6b749c4b (C:\WINDOWS\System32\ucrtbase.dll+0x19c4b) #3 0x00007ffb6b749c04 (C:\WINDOWS\System32\ucrtbase.dll+0x19c04) #4 0x00007ffb6b7487d2 (C:\WINDOWS\System32\ucrtbase.dll+0x187d2) #5 0x00007ffb6b74875b (C:\WINDOWS\System32\ucrtbase.dll+0x1875b) #6 0x00007ffb6b7486fe (C:\WINDOWS\System32\ucrtbase.dll+0x186fe) #7 0x00007ff76eb7205f operator new[](unsigned __int64) (D:\work\libs\cling\src\build\Release\bin\cling.exe+0x2d3205f) #8 0x00007ffb6dce7c24 (C:\WINDOWS\System32\KERNEL32.DLL+0x17c24) #9 0x00007ffb6e82d721 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6d721)
@bellenot It is not the endl that gives me a headache, it is the callstack output |
@bellenot It is not the endl that gives me a headache, it is the callstack output (Sorry for the double reply, I am not so used with using github activities editing.) Should I open a new issue for the following ? @bellenot I tried now to compile with VS2019. I just dowloaded the buildtools 2019 for compilation. No success. I get 69 messages like the following (unfortunately German): Line 84: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable [D:\work\libs\cling\src\build\lib\Target\BPF\AsmParser\LLVMBPFAsmParser.vcxproj] Line 97: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. [D:\work\libs\cling\src\build\lib\Target\BPF\AsmParser\LLVMBPFAsmParser.vcxproj] Line 106: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAbstractMemberAccess.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 119: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAbstractMemberAccess.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 121: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAsmPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] |
Please update cling, this should have been fixed last week or so |
@bellenot just updated cling. The same error type persists. only 50.
boost.modulemap list of errors: Line 84: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable [D:\work\libs\cling\src\build\lib\Target\BPF\AsmParser\LLVMBPFAsmParser.vcxproj] Line 97: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. [D:\work\libs\cling\src\build\lib\Target\BPF\AsmParser\LLVMBPFAsmParser.vcxproj] Line 106: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFISelLowering.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 119: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFISelLowering.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 121: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAsmPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 133: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAbstractMemberAccess.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 145: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAsmPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 149: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFAbstractMemberAccess.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 151: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFISelDAGToDAG.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 157: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFMISimplifyPatchable.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 177: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFISelDAGToDAG.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 179: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFMISimplifyPatchable.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 181: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFMIPeephole.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 194: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFMIPeephole.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 196: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFMIChecking.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 209: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\BPFMIChecking.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\LLVMBPFCodeGen.vcxproj] Line 215: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFMCCodeEmitter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 228: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFMCCodeEmitter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 230: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFAsmBackend.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 243: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFAsmBackend.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 245: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFMCTargetDesc.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 258: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFMCTargetDesc.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 260: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFELFObjectWriter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 273: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\BPF\MCTargetDesc\BPFELFObjectWriter.cpp) [D:\work\libs\cling\src\build\lib\Target\BPF\MCTargetDesc\LLVMBPFDesc.vcxproj] Line 276: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable [D:\work\libs\cling\src\build\lib\Target\BPF\Disassembler\LLVMBPFDisassembler.vcxproj] Line 289: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. [D:\work\libs\cling\src\build\lib\Target\BPF\Disassembler\LLVMBPFDisassembler.vcxproj] Line 373: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVISelDAGToDAG.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 386: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVISelDAGToDAG.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 388: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVMCInstLower.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 400: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVAsmPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 412: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVMCInstLower.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 416: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVAsmPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 418: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVTargetMachine.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 429: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVExpandPseudoInsts.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 442: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVMergeBaseOffset.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 449: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVTargetMachine.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 458: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVExpandPseudoInsts.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 461: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVMergeBaseOffset.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 463: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVISelLowering.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 476: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\RISCVISelLowering.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\LLVMRISCVCodeGen.vcxproj] Line 480: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\MCTargetDesc\RISCVMCTargetDesc.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\MCTargetDesc\LLVMRISCVDesc.vcxproj] Line 486: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\MCTargetDesc\RISCVInstPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\MCTargetDesc\LLVMRISCVDesc.vcxproj] Line 506: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\MCTargetDesc\RISCVInstPrinter.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\MCTargetDesc\LLVMRISCVDesc.vcxproj] Line 508: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. (Quelldatei wird kompiliert D:\work\libs\cling\src\lib\Target\RISCV\MCTargetDesc\RISCVMCTargetDesc.cpp) [D:\work\libs\cling\src\build\lib\Target\RISCV\MCTargetDesc\LLVMRISCVDesc.vcxproj] Line 511: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable [D:\work\libs\cling\src\build\lib\Target\RISCV\Disassembler\LLVMRISCVDisassembler.vcxproj] Line 524: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. [D:\work\libs\cling\src\build\lib\Target\RISCV\Disassembler\LLVMRISCVDisassembler.vcxproj] Line 528: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable [D:\work\libs\cling\src\build\lib\Target\RISCV\Utils\LLVMRISCVUtils.vcxproj] Line 541: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. [D:\work\libs\cling\src\build\lib\Target\RISCV\Utils\LLVMRISCVUtils.vcxproj] Line 544: D:\work\libs\cling\src\include\llvm/Support/type_traits.h(186,23): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable [D:\work\libs\cling\src\build\lib\ExecutionEngine\RuntimeDyld\LLVMRuntimeDyld.vcxproj] Line 557: D:\work\libs\cling\src\include\llvm/ADT/SmallVector.h(315,32): error C2976: "llvm::SmallVectorTemplateBase": Nicht gen�gend Vorlage-Argumente. [D:\work\libs\cling\src\build\lib\ExecutionEngine\RuntimeDyld\LLVMRuntimeDyld.vcxproj] |
Did you update LLVM & Clang as well? (sorry the fix was in |
@bellenot seems to be the case. The vsbuildtools 2019 are brand new! for safety here the git log output of src, tools/cling, tools/clang: src/ commit 43ad01796dee907e320eb06223f3bd61c335dd6c (HEAD -> cling-patches, tag: cling-patches-rrelease_90, tag: ROOT-patches-rrelease_90, origin/cling-patches, origin/ROOT-patches) Author: Vassil Vassilev Date: Wed Mar 3 19:31:18 2021 +0000 Add missing includes. tools/clang: commit ddd3a61c4ec7cb9661e8dc9781dc797f70537519 (HEAD -> cling-patches, tag: cling-patches-rrelease_90, origin/cling-patches) Author: Vassil Vassilev Date: Tue Aug 25 19:36:56 2020 +0000 Allow interfaces to operate on in-memory buffers with no source location info. This patch avoid an assert PresumedLoc::getFilename if it is invalid. tools/cling: commit df5fbb3c46a92a0841145cde0655e26c88ddff1b (tag: __internal-root-08c5147a876ca5215464b628d8e4bc6634d80167, origin/master, origin/HEAD) Author: Bertrand Bellenot Date: Tue Mar 23 09:53:23 2021 +0100 Fix unresolved external symbol errors on Windows |
Please make sure that
And re-build |
@bellenot the ifdef part below is missing and it is compiling now for a while again .... |
No idea, I don't have VS 2017 anymore |
@bellenot compiles now. Great. Still this nasty call stack. Do you have this also ? [cling]$ .q #0 0x00007ff71cf5e3b1 operator new[](unsigned __int64) (d:\work\libs\cling\src\build\Release\bin\cling.exe+0x2dee3b1) #1 0x00007ffb9e0f9d26 (C:\WINDOWS\System32\ucrtbase.dll+0x19d26) #2 0x00007ffb9e0f9c4b (C:\WINDOWS\System32\ucrtbase.dll+0x19c4b) #3 0x00007ffb9e0f9c04 (C:\WINDOWS\System32\ucrtbase.dll+0x19c04) #4 0x00007ffb9e0f87d2 (C:\WINDOWS\System32\ucrtbase.dll+0x187d2) #5 0x00007ffb9e0f875b (C:\WINDOWS\System32\ucrtbase.dll+0x1875b) #6 0x00007ffb9e0f86fe (C:\WINDOWS\System32\ucrtbase.dll+0x186fe) #7 0x00007ff71cede6f3 operator new[](unsigned __int64) (d:\work\libs\cling\src\build\Release\bin\cling.exe+0x2d6e6f3) #8 0x00007ffba04f7c24 (C:\WINDOWS\System32\KERNEL32.DLL+0x17c24) #9 0x00007ffba0ecd721 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6d721) |
Well, I only saw it when using |
@bellenot you are right. I tested a bit wildly around. And only if I use 'endl' it happens. I have a certain talent to find immediately the combination that produces failures. My fate. I am dreaded for this, but it helps to get a better user experience afterwards. |
Resolves root-project/cling#399 Fix the following linker errors: 253>cling.exp : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl clang::QualType::getAsString(class clang::Type const *,class clang::Qualifiers)" (?getAsString@QualType@clang@@sa?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@z) 253>cling.exp : error LNK2001: unresolved external symbol "private: virtual void __cdecl llvm::raw_ostream::handle(void)" (?handle@raw_ostream@llvm@@EEAAXXZ) 253>D:\work\libs\cling\src\build\Release\bin\cling.exe : fatal error LNK1120: 2 unresolved externals
When building with an actual checkout on Windows the build of cling itself fails with a linker error, while llvm and clang is completely compiled.
Is there any hint how to fix this ?
Thanks
Thomas
Here is the linker error:
cling.cpp
253>Auto build dll exports
253> Creating library D:/work/libs/cling/src/build/Release/lib/cling.lib and object D:/work/libs/cling/src/build/Release/lib/cling.exp
253>cling.exp : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl clang::QualType::getAsString(class clang::Type const *,class clang::Qualifiers)" (?getAsString@QualType@clang@@sa?AV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@PEBVType@2@VQualifiers@2@@z)
253>cling.exp : error LNK2001: unresolved external symbol "private: virtual void __cdecl llvm::raw_ostream::handle(void)" (?handle@raw_ostream@llvm@@EEAAXXZ)
253>D:\work\libs\cling\src\build\Release\bin\cling.exe : fatal error LNK1120: 2 unresolved externals
The text was updated successfully, but these errors were encountered: