Error installing Chromium on Windows: assert vc_lib_um_path - windows

I'm trying to install Chromium on my Windows machine. I'm closely following the instructions linked to from the Chromium project site. I tried running the command gn gen out/Default, but got the following error message (with some paths anonymized):
Traceback (most recent call last):
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 292, in <module>
main()
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 284, in main
assert vc_lib_um_path
AssertionError
ERROR at //build/toolchain/win/BUILD.gn:408:30: Script returned non-zero exit code.
win_64bit_toolchain_data = exec_script("setup_toolchain.py",
^----------
Current dir: C:/path/to/chromium/src/out/Default/
Command: C:/path/to/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)/Microsoft Visual Studio/2017/Enterprise" "C:\Program Files (x86)\Windows Kits\10" "C:\WINDOWS\Sysnative;C:\WINDOWS/SysWOW64" win x64 environment.x64
Returned 1 and printed out:
vc_bin_dir = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX64\\x64"
include_flags_I = "\"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\include\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt\" \"/I..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt\""
include_flags_imsvc = "\"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\include\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt\""
vc_lib_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\lib\\x64"
vc_lib_atlmfc_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\ATLMFC\\lib\\x64"
See //build/toolchain/win/BUILD.gn:458:1: whence it was called.
win_64bit_toolchains("x64") {
^----------------------------
See //BUILD.gn:61:1: which caused the file to be included.
group("gn_all") {
^----------------
Traceback (most recent call last):
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 292, in <module>
main()
File "C:/path/to/chromium/src/build/toolchain/win/setup_toolchain.py", line 284, in main
assert vc_lib_um_path
AssertionError
Looking at the source for setup_toolchain.py (where the error was), I think the problem is on these lines:
for path in env['LIB'].split(';'):
if os.path.exists(os.path.join(path, 'User32.Lib')):
vc_lib_um_path = os.path.realpath(path)
break
After adding some print statements, it appears that the loop is checking if the following paths exist:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\ATLMFC\lib\x64\User32.Lib
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\lib\x64\User32.Lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64\User32.Lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.17134.0\um\x64\User32.Lib
User32.Lib
None of these paths do exist. I don't really have a good enough understanding of Windows, Visual Studio, or C to know what User32.Lib means. Is it something that Visual Studio should have added somewhere? Or when I installed the Windows 10 SDK, should a file have been generated somewhere? Is there something I can do to solve this problem?
I'm struggling to figure out what could go wrong and cause this problem, and any help would be greatly appreciated.

Looks like GN does not find the required runtime requirements. The scripts are somewhat fragile on this.
In my case, I installed visual 2017 and 2019, this issue happens. So, I uninstall visual 2019 and it works well.
Reverify the runtime specs (SDK, VS version, paths etc).
https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md#markdown-header-windows-setup

Related

fatal error C1083: Cannot open file: atlconv.h: No such file or directory

I am using VS 2019 Professional.
File atlconv.h exists at
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Professional\VC\Tools\MSVC\14.16.27023\atlmfc\include
However, there're two folders at
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Professional\VC\Tools\MSVC\
14.16.27023 and 14.28.29333.
What paths does visual studio 2019 use when looking for atlconv.h?
Where can I find out about paths?

Cannot open file 'pgort.llib' after adding /GENPROFILE flag

I'm trying to follow the instructions here to add PGO for my project. After I added the /GENPROFILE flag, I start getting the link error:
LINK : fatal error LNK1104: cannot open file 'pgort.lib'
After debugging it a bit, I believe the problem is that my Library Directories (found under VC++ Directories tab) has a value of $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) which is evaluating to:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\spectre\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\atlmfc\lib\spectre\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\VS\lib\x64
C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\VS\UnitTest\lib
C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\lib\um\x64
It looks like the .\spectre\x64 paths don't have the pgort.lib library, but the non-spectre path does:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64
What do I do to fix this? I find it hard to believe that if I'm using the spectre binaries (which I am not even sure how/why I am in the first place) that I can't optimize my project.
BTW, I tried this on a machine with Enterprise VS installed and it's the same. So this isn't specific to Community edition.
I ended up updating my build configuration/scripts to dynamically update the LibraryPath to add the appropriate, architecture-specific version of $(VC_LibraryPath_VC_x64_Desktop) when compiling for PGO.

fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory

I am referring to C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ WDK files. Though I have installed latest 10.0.15063.0. It seems some files are missing in 10.0.14393 folder.
Anyone could help me to in this. Reparing Microsoft Visual Studio15 or reparing wdk 10.0.15063 does not help.
Ensure you have installed "Universal CRT" component of your visual studio.
More over for newer versions of Visual studio
in case the directory "C:\Program Files\Windows Kits" exists on your system ensure that it contains "10/Include" and "10/Lib" subdirectories.
If not create hard links there to thoose present in your "C:\Program Files (x86)\Windows Kits\10"
As you can see from C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
the path "C:\Program Files\Windows Kits" is prefered over "C:\Program Files (x86)\Windows Kits" if it exists.
In Visual studio go to Project -> Properties -> VC++ Directories -> Include Directories and add:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt
In Project -> Properties -> VC++ Directories -> Library Directories add:
C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64
That's it, your program should now compile without errors!

Visual Studio 2017 msbuild package sharepoint

I have a simple SharePoint 2013 solution which I can publish through Visual Studio - this will generate .wsp for me. However when I am trying to run build by the command:
msbuild /t:Package mySolution.sln
Build is ok but during packaging I receive an error:
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(190,5): error : Could not load file or assembly
'Microsoft.VisualStudio.Modeling.Sdk.15.0, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
If I put this missing dll to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools then I receive another error about another missing dll...
What am I doing wrong?
Looks like this is MSBuild issue:
1.Open elevated command prompt
2.Navigate to your SDK tools
cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64"
Sn -Vr "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll"
gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll"
For the following three dlls, please do same behavior from step 3 to 4
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SharePoint.dll
Note if Microsoft.VisualStudio.SharePoint.dll not found in above path, check in
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools\Microsoft.VisualStudio.SharePoint.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.SharePoint.Designers.Models.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.SharePoint.Designers.Models.Features.dll
Now you can MSBuild your SharePoint 2016 solutions by VS command promp.
Check Link, that's for Sharepoint 2016, but same works for 2013 as well: https://developercommunity.visualstudio.com/content/problem/40195/cant-use-msbuild-to-package-sharepoint-2016-soluti.html

VS2012 doesn't include winres.h any more?

After installing VS2012, I can't find winres.h under folder "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC". What happen to VS2012 and why remove this header file?
By the way, in VS2010, winres.h locates in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include"
The file is part of the Windows SDK now and since VS2012 the SDK location is different, it's now called a 'Kit' and is found in Program Files/Windows Kits. Sepcifically you can find winres.h in
C:\Program Files (x86)\Windows Kits\8.0\Include\um

Resources