Skip to content
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

LLVM doesn't compile with Visual Studio 2017 Express edition: missing atlbase.h #41936

Open
llvmbot opened this issue Jul 11, 2019 · 4 comments
Labels
bugzilla Issues migrated from bugzilla build-problem confirmed Verified by a second party debuginfo

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 11, 2019

Bugzilla Link 42591
Version 8.0
OS Windows XP
Reporter LLVM Bugzilla Contributor
CC @JDevlieghere,@walkerkd,@pogo59,@rnk

Extended Description

I ran into an issue when attempting to compile LLVM on Windows 10 using the Visual Studio 2017 Express edition. Express edition does not come with ATL support, and several files have a dependency on atlbase.h.

It is possible to install ATL for 2017 as part of the Visual Studio Build Tools ["C++ ATL for for v141 build tools (x86 & x64)"]. But only Build Tools 2019 is available, and the ATL header/lib files get installed in the "C:\Program Files (x86)\Microsoft Visual Studio\2019" not "...2017" directory. The CL compiler can't find them in that non-standard location.

This problem is fixed by using Visual Studio 2017 Community Edition or higher, which have ATL support build-in. But unfortunately the Express edition is the only version that allows for free commercial use.

Is it possible to make LLVM independent of ATL when it's not available? If no, I suggest you modify your Getting Started guide (https://llvm.org/docs/GettingStarted.html) to mention that VS Express Edition is not supported.

Compile log snip...

C:\build\2017\llvm>cmake --build . --config Release
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

etc...

DIAEnumSourceFiles.cpp
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIAEnumFrameData.c
pp) [C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIADataStream.cpp)
[C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIAEnumDebugStream
s.cpp) [C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIAEnumInjectedSou
rces.cpp) [C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIAEnumSectionCont
ribs.cpp) [C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIAEnumLineNumbers
.cpp) [C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
v:\llvm-project\llvm\include\llvm\debuginfo\pdb\dia\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atl
base.h': No such file or directory (compiling source file V:\llvm-project\llvm\lib\DebugInfo\PDB\DIA\DIAEnumSourceFiles
.cpp) [C:\build\2017\llvm\lib\DebugInfo\PDB\LLVMDebugInfoPDB.vcxproj]
DIAEnumSymbols.cpp

@rnk
Copy link
Collaborator

rnk commented Jul 11, 2019

I think you can disable DIA support. I don't know to what extend DIA depends on ATL or if LLVM uses ATL, but I do know that it should be limited to the LLVM code that uses DIA, which is optional.

@rnk
Copy link
Collaborator

rnk commented Jul 11, 2019

I meant to mention, you can disable DIA support by passing -DLLVM_ENABLE_DIA_SDK=OFF to cmake, and then the build should succeed with VS express.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@llvmbot llvmbot added the confirmed Verified by a second party label Jan 26, 2022
@h-vetinari
Copy link
Contributor

h-vetinari commented May 19, 2024

I've started hitting this with llvm 18.1.6 using VS2022 (targetting vc142, so like VS2019). This didn't happen for any other llvm release since 11.x (which was when I started to get involved).

[545/3645] Building CXX object lib\DebugInfo\PDB\CMakeFiles\LLVMDebugInfoPDB.dir\PDB.cpp.obj
FAILED: lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDB.cpp.obj 
C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\HostX64\x64\cl.exe  /nologo /TP -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I%SRC_DIR%\build\lib\DebugInfo\PDB -I%SRC_DIR%\llvm\lib\DebugInfo\PDB -I%SRC_DIR%\build\include -I%SRC_DIR%\llvm\include -external:I"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\DIA SDK\include" -external:I%PREFIX%\Library\include -external:W0 -MD  /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2 /DNDEBUG -std:c++17 -MD  /EHs-c- /GR /showIncludes /Folib\DebugInfo\PDB\CMakeFiles\LLVMDebugInfoPDB.dir\PDB.cpp.obj /Fdlib\DebugInfo\PDB\CMakeFiles\LLVMDebugInfoPDB.dir\LLVMDebugInfoPDB.pdb /FS -c %SRC_DIR%\llvm\lib\DebugInfo\PDB\PDB.cpp
%SRC_DIR%\llvm\include\llvm\DebugInfo\PDB\DIA\DIASupport.h(25): fatal error C1083: Cannot open include file: 'atlbase.h': No such file or directory

@h-vetinari
Copy link
Contributor

To follow up here, Microsoft deleted some components out of their images, which caused this failure: actions/runner-images#9873.

In particular, installing

                  "Microsoft.VisualStudio.Component.VC.v141.ATL"
                  "Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL"

(or whatever equivalent for the given VS version) should fix things.

I guess this issues can thus be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla build-problem confirmed Verified by a second party debuginfo
Projects
None yet
Development

No branches or pull requests

4 participants