fatal error: 'atldef.h' file not found

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

fatal error: 'atldef.h' file not found

Postby alextusinean » Thu Jan 07, 2021 4:02 pm

So I've been trying to build CEF (branch 4280) by myself because I need MP4 and other codecs support, but the build fails because of an 'atldef.h' file missing. I've tried searching about it and adding Visual C++ ATL support component to my VS2019 installation but it didn't work. I do have the Windows SDK downloaded from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/. Here's the full Ninja output:
Code: Select all
D:\cef\chromium_git\chromium\src>ninja -C out\Debug_GN_x86 cef
ninja: Entering directory `out\Debug_GN_x86'
[1/35131] CXX obj/base/base/atl_throw.obj
FAILED: obj/base/base/atl_throw.obj
..\..\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe /nologo /showIncludes:user "-imsvcC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-imsvcD:\Windows Kits\10\include\10.0.19041.0\ucrt" "-imsvcD:\Windows Kits\10\include\10.0.19041.0\shared" "-imsvcD:\Windows Kits\10\include\10.0.19041.0\um" "-imsvcD:\Windows Kits\10\include\10.0.19041.0\winrt" "-imsvcD:\Windows Kits\10\include\10.0.19041.0\cppwinrt" -DDCHECK_ALWAYS_ON=1 -DUSE_AURA=1 -DOFFICIAL_BUILD "-DCR_CLANG_REVISION=\"llvmorg-12-init-5035-gd0abc757-3\"" -D_HAS_NODISCARD -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_DEBUG=0 -D_LIBCPP_NO_AUTO_LINK -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_VB -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -DBUILDING_CEF_SHARED -DUSING_CHROMIUM_INCLUDES -I../.. -Igen -I../../cef -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -enable-dse-memoryssa=false -fcomplete-member-pointers /Gy /FS /bigobj /utf-8 /Zc:twoPhase /Zc:sizedDealloc- /X /D__WRL_ENABLE_FUNCTION_STATICS__ -fmsc-version=1916 /guard:cf,nochecks -m32 /Brepro -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes /W4 -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi /WX /wd4091 /wd4127 /wd4251 /wd4275 /wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4200 /wd4201 /wd4204 /wd4221 /wd4245 /wd4267 /wd4305 /wd4389 /wd4702 /wd4701 /wd4703 /wd4661 /wd4706 /wd4715 /wd4267 -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens /Z7 -gcodeview-ghash -Xclang -debug-info-kind=constructor -ftrivial-auto-var-init=pattern /MT -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wglobal-constructors -Wexit-time-destructors -Wshadow -Wexit-time-destructors /O2 /Ob2 /Oy- /Zc:inline /Gw -Wno-trigraphs /TP /wd4577 /GR- -I../../buildtools/third_party/libc++/trunk/include /c ../../base/win/atl_throw.cc /Foobj/base/base/atl_throw.obj /Fd"obj/base/base_cc.pdb"
In file included from ../../base/win/atl_throw.cc:5:
../..\base/win/atl_throw.h(35,10): fatal error: 'atldef.h' file not found
#include <atldef.h>
         ^~~~~~~~~~
1 error generated.
[6/35131] CXX obj/base/base/platform_thread_win.obj
ninja: build stopped: subcommand failed.


I have also tried to redownload the source code thrice, but the same error occurs.
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: fatal error: 'atldef.h' file not found

Postby magreenblatt » Thu Jan 07, 2021 4:23 pm

Are you using the free version of Visual Studio? If so, I don’t believe it includes ATL/MFC support. If not, try re-installing Visual Studio with the required components as described here.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: fatal error: 'atldef.h' file not found

Postby alextusinean » Thu Jan 07, 2021 4:29 pm

magreenblatt wrote:Are you using the free version of Visual Studio? If so, I don’t believe it includes ATL/MFC support. If not, try re-installing Visual Studio with the required components as described here.


Yes, I do use the free version of Visual Studio (2019 Community). What can I do to build CEF then, if the free version of VS doesn't support ATL?
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: fatal error: 'atldef.h' file not found

Postby magreenblatt » Thu Jan 07, 2021 4:34 pm

You can try the Chromium instructions here which suggest that it will work with Community edition. I have not tried building with Community edition myself.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: fatal error: 'atldef.h' file not found

Postby ndesktop » Fri Jan 08, 2021 1:17 am

ATL is available on VS Community 2019.
(I do have multiple VS versions installed, both Professional and Community).

Run Modify of the existing installation from apps, the support for ATL should be there.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: fatal error: 'atldef.h' file not found

Postby alextusinean » Mon Jan 11, 2021 1:32 am

ndesktop wrote:ATL is available on VS Community 2019.
(I do have multiple VS versions installed, both Professional and Community).

Run Modify of the existing installation from apps, the support for ATL should be there.

I've tried that before (and I still have the components), but the error still occurs. Sorry for the inactivity of the topic, I wasn't home these days.
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: fatal error: 'atldef.h' file not found

Postby ndesktop » Mon Jan 11, 2021 7:32 am

My installation is in C:\bin\vs\2019\community and for each directory VC\Tools\MSVC\14.x.y\atlmfc\include there is atldef.h.
I'm not seeing an include path with 2019 inside ninja -imsvc directives. Maybe is something related to GYP_MSVS_VERSION/GYP_MSVS_OVERRIDE_PATH/VS2019_INSTALL ?
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: fatal error: 'atldef.h' file not found

Postby akhudairy » Mon Jan 11, 2021 8:02 am

ndesktop wrote:My installation is in C:\bin\vs\2019\community and for each directory VC\Tools\MSVC\14.x.y\atlmfc\include there is atldef.h.
I'm not seeing an include path with 2019 inside ninja -imsvc directives. Maybe is something related to GYP_MSVS_VERSION/GYP_MSVS_OVERRIDE_PATH/VS2019_INSTALL ?


Hey. I had a similar problem before. Turned out the build was still referring to a MSVC version which was not on my computer anymore! If you running the steps in Master Build document (https://bitbucket.org/chromiumembedded/ ... ckStart.md), I was advised by magreenblatt to repeat step 7, and it worked after that.

I think you might also check the documentation in the automated build documentation (https://bitbucket.org/chromiumembedded/ ... figuration) .. check below this line (If Visual Studio or Windows SDK is not installed to the default location then set environment variables like the following before executing automate-git.py), and see how to set the (include) and (lib) and (path).
akhudairy
Techie
 
Posts: 24
Joined: Wed Oct 21, 2020 7:35 am

Re: fatal error: 'atldef.h' file not found

Postby alextusinean » Mon Jan 11, 2021 1:15 pm

akhudairy wrote:
ndesktop wrote:My installation is in C:\bin\vs\2019\community and for each directory VC\Tools\MSVC\14.x.y\atlmfc\include there is atldef.h.
I'm not seeing an include path with 2019 inside ninja -imsvc directives. Maybe is something related to GYP_MSVS_VERSION/GYP_MSVS_OVERRIDE_PATH/VS2019_INSTALL ?


Hey. I had a similar problem before. Turned out the build was still referring to a MSVC version which was not on my computer anymore! If you running the steps in Master Build document (https://bitbucket.org/chromiumembedded/ ... ckStart.md), I was advised by magreenblatt to repeat step 7, and it worked after that.

I think you might also check the documentation in the automated build documentation (https://bitbucket.org/chromiumembedded/ ... figuration) .. check below this line (If Visual Studio or Windows SDK is not installed to the default location then set environment variables like the following before executing automate-git.py), and see how to set the (include) and (lib) and (path).


I've just tried adding the environment variables for VS/Windows SDK (from https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-windows-configuration) to the update.bat file, ran it (without deleting the existing source code), tried building again and the same error occurs. There's still no -imsvc argument that holds the atlmfc include directory. Maybe I have to delete the downloaded source code before running update.bat again?

Oh and also, I've just noticed that my VS 2017 BuildTools installation's include directories are used. Shouldn't VS 2019 ones be used?
alextusinean
Techie
 
Posts: 17
Joined: Thu Jan 07, 2021 3:23 pm

Re: fatal error: 'atldef.h' file not found

Postby ndesktop » Mon Jan 11, 2021 2:08 pm

alextusinean wrote:Oh and also, I've just noticed that my VS 2017 BuildTools installation's include directories are used. Shouldn't VS 2019 ones be used?

That's what I said myself. Try to use the environment variables from the previous post explicitly, then rerun the automate script or whatever batch/shell script you are using.
Maybe it's because you are not using Windows SDK from a default location, I'm not sure - you can modify temporarily the vs toolchain script from src/build/ to check if there is not some arcane error you are overlooking.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 69 guests