Build CEF on Windows 10 - c++

The compilation of the CEF in Windows 10 until now has been a week of work and various remediation. Now it seems that I am at the last steps of the compilation but I have a problem not yet solved, Ninja fails at
[30545/36949] ACTION //tools/v8_context_snapshot:gener..._context_snapshot(//build/toolchain/win:win_clang_x86)
FAILED: v8_context_snapshot.bin
C:/code/depot_tools/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe ../../build/gn_run_binary.py ./v8_context_snapshot_generator --output_file=v8_context_snapshot.bin
[1203/185351.657:FATAL:com_init_check_hook.cc(159)] Check failed: false. CoCreateInstance appears to be previously patched. <cc cc cc cc cc e9 2b> Attempted to write <e9 80 2f d6 91 eb f9>
My enviroment Windows10, VS 2017 v 15.9.28, Win 10.0.17763 SDK and Ninja.
Does anyone know what it can be?
Thank you very much kind regards

I was finally able to compile CEF with .mp4 support for the chosen version v75. I share with you all the steps necessary to compile in the windows environment.
What's Required for branch 3770 --> Chromium Version v 75.
Win 7+, VS2017 15.7.1+, Win 10.0.17763 SDK, Ninja, at least 8GB of RAM and 40GB of free disk space. Need particular attention to the SDK version, installed it separately and not with Visual Studio, moreover it must necessarily be the one indicated, if there are later versions uninstall them completely.
Install the required Visual Studio sub-components by passing the following arguments to the Visual Studio installer:
$ PATH_TO_INSTALLER.EXE ^
--add Microsoft.VisualStudio.Workload.NativeDesktop ^
--add Microsoft.VisualStudio.Component.VC.ATLMFC ^
--includeRecommended
See https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-current-release-branches-supported.
For Download and correct build step by step see:https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart
This procedure as it is only the download of the Master proceeds,
If you want to compile a specific branch, compile the path where to download it and modify the update.bat file accordingly.
Set all necessary enviroment variable and restart the PC before all:
Variable CEF_USE_GN value CEF_USE_GN=1
Variable GN_DEFINES value Set GN_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
Variable Path add value of C:\code\depot_tools your path for folder depot_tools.
Variable DEPOT_TOOLS_WIN_TOOLCHAIN valore DEPOT_TOOLS_WIN_TOOLCHAIN=0.
For example for the 3770 branch
build the path C: \ code \ chromium_git3770
and write in update.bat like:
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
python ..\automate\automate-git.py --download-dir=C:\code\chromium_git3770 --depot-tools-dir=C:\code\depot_tools --branch=3770 --no-distrib --no-build
and the Create.bat like:
set CEF_USE_GN=1
set GN_DEFINES=is_official_build=true proprietary_codecs=true ffmpeg_branding=Chrome
set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
call cef_create_projects.bat
Resolve error:
Error on build with Ninja
try running “gclient runhooks” from the chromium/src directory always from cmd
this command renews the files in depot_tools
on Windows 10 especially there are various problems and various issues (node.js is missing, etc.)
ImportError: No module named win32file
Install correct WinApi on python folder.
C:\code\depot_tools>python -m pip install pywin32
Error FAILED: v8_context_snapshot.bin
where suggested running "gn clean" before a full build in all out path to build, after each build with error.
Wait about 4 hours and you will have your buil.

Related

How to fix " --asar does not take any arguments, it only has sub-properties" warning

At the last step of my application when I want to build my desktop app (for windows 10 OS) with "npm run package-win" command I am getting the same warning in the title. Other problem is application's exe file occurs but gives error. "The code execution cannot proceed because ffmpeg.dll was not found. Reinstalling the program may fix the problem."
I reinstalled the program several times, I changed my package.json's scripts I thought it is because of asar's dependencies
PS C:\Users\osman.turalioglu\Projects\project> npm run package-win
project#1.0.0 package-win C:\Users\osman.turalioglu\Projects\project>
electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="project"
WARNING: --asar does not take any arguments, it only has sub-properties (see --help)
Packaging app for platform win32 ia32 using electron v5.0.6
Wrote new app to release-builds\project-win32-ia32
I expect my desktopp app' exe file builded
hi the error its pretty explicit, go to package.json on scripts section on package-win line, look for --asar=true remove the true leaving only --asar, the asar property is true by default

Building VirtualBox without GUI or Guest Additions

I'm trying to build VirtualBox 5.2.18 on Ubuntu Server LTS 18.04 64-bit. I want to build it without any GUI components and without Guest Additions, as I want to avoid installing any unnecessary dependencies. I am using the following options when configuring:
./configure --build-headless --disable-qt --disable-alsa --disable-pulse --disable-opengl --disable-sdl-ttf --disable-libvpx --disable-docs
Although there is an option to only build the Guest Additions (--only-additions), there doesn't seem to be an option passable to configure to skip building Guest Additions. Is there a way to skip building Guest Additions, or perhaps to ignore any build-time errors related to building Guest Additions?
I found a solution in https://forums.virtualbox.org/viewtopic.php?t=33090&start=0, which contains more useful details. One can build VirtualBox without GUI or Guest Additions by adding the following lines to LocalConfig.kmk in the root of the development tree:
VBOX_WITHOUT_ADDITIONS = 1
VBOX_WITH_HEADLESS = 1
VBOX_WITH_VRDP=
VBOX_WITH_VRDP_VIDEO_CHANNEL=
VBOX_WITH_VRDP_AUTHMOD=
VBOX_WITH_VRDP_RDESKTOP=
VBOX_WITH_VBOXFB=
VBOX_WITH_KCHMVIEWER=
VBOX_WITH_TESTSUITE=
VBOX_WITH_TESTCASES=
VBOX_WITH_SHARED_FOLDERS=
VBOX_WITH_SHARED_CLIPBOARD=
VBOX_WITH_VNC =
VBOX_X11_SEAMLESS_GUEST=
VirtualBox can then be built by executing the following in the root folder:
./configure --build-headless --disable-qt --disable-alsa --disable-pulse --disable-opengl --disable-sdl-ttf --disable-libvpx --disable-docs
source env.sh
kmk
It is unclear which of the options is necessary for skipping the building of the guest additions (in either LocalConfig.kmk or those passed to ./configure).
When kmk packing is executed, the following error message might appear:
kmk: *** No rule to make target `.../out/linux.amd64/release/bin/additions/VBoxGuestAdditions.iso',
needed by `.../out/linux.amd64/release/obj/Installer/linux/archive/additions/VBoxGuestAdditions.iso'.
Stop.
This error can be avoided by executing a touch command before kmk packing (this fix was obtained from https://forums.virtualbox.org/viewtopic.php?f=10&t=41598&p=187420&hilit=VBoxGuestAdditions#p187420):
kmk
mkdir -p out/linux.amd64/release/bin/additions/
touch out/linux.amd64/release/bin/additions/VBoxGuestAdditions.iso
kmk packing
The mkdir command was added before touch because touch might fail if the directory out/linux.amd64/release/bin/additions/ did not exist.
Some errors might come up during installation of VirtualBox-*.run, but it should successfully completely. However, if you try to execute VBoxManage, you might get the following error:
Could not find VirtualBox installation. Please reinstall.
This arises most probably because the executable file VirtualBox was not found in the installation folder (usually /opt/VirtualBox). The file VirtualBox is the GUI component which was not built. We can bypass the error by editing VBox.sh in the installation folder, and changing the line
elif test -f "${MY_DIR}/VirtualBox" && test -x "${MY_DIR}/VirtualBox"; then
to
elif test -f "${MY_DIR}/VBoxHeadless" && test -x "${MY_DIR}/VBoxHeadless"; then
VirtualBox should now run without any problems.

LNK1181 error when compiling V8 engine on Win10

I'm following this guide on building V8 but I am hitting some issues on the compilation step. I am running Windows 10 x64. I am trying to compile with options to embed the engine also.
Running the following command:
ninja -C out.gn/x64.release
Gives me this error:
ninja: Entering directory `out.gn/x64.release'
[1/471] LINK mksnapshot.exe mksnapshot.exe.pdb
FAILED: mksnapshot.exe mksnapshot.exe.pdb
C:/Workspace/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./mksnapshot.exe /PDB:./mksnapshot.exe.pdb #./mksnapshot.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'comdlg32.lib'
ninja: build stopped: subcommand failed.
Now I believe I have narrowed down the error to looking for the .lib files in the wrong directory. I have (had) multiple versions installed, so there were multiple folders in my Windows Kit install.
Windows Kits/10/Lib/10.0.16299.0
Windows Kits/10/Lib/10.0.15xxx.0
If I dragged and dropped the comdlg32.lib file from 10.0.16299.0 into the 10.0.15xxx.0 directory then the error changed to a LNK1181 error with a different input file. I did this a few times but I was unsure if this was going to cause issues with different versions and there was probably going to be a lot.
I uninstalled the 10.0.15xxx.0 version which left behind the folder I mentioned, so I removed that and after doing so I have started getting the LNK1181 error with a different input file (advapi32.lib I assume the very first file it can't find). This is how I came to the conclusion about the path being incorrect.
So I have tried a few things to change the path (I hoped just uninstalling the old version would fix it) such as:
Uninstalling the old version.
Going through registry entries to see if I can find an install path or something using that path, which I didn't. I did notice that there was still installation and data in the registry for the 10.0.15xxx.0 install, I might try deleting that from the registry directly as a last resort?
I have tried to explicitly set the path by setting <TargetUniversalCRTVersion>10.0.16299.0</TargetUniversalCRTVersion> in this file: C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
I have never used Ninja before so I tried looking for a way to set some kind of lib-path in the command but couldn't really find anything.
I looked through the python scripts being executed to try and locate something to do with the libs path but couldn't see anything.
I would be grateful for any help and suggestions. Thanks.
You can try to compile v8 using Visual Studio as explained here: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#using-the-visual-studio-ide
By running the following commands:
$ gn gen --ide=vs out.gn/x64.release
$ cd out.gn/x64.release
$ msbuild all.sln
You can see a full example here: https://github.com/phpv8/v8js/issues/272#issuecomment-262848754
Apparently this method is not officially supported anymore, but I had the same problem as you have and this solved the issue for me.
Note that after this I had another issue, the unit tests failed to be compiled due to a linking error, but I had the necessary libraries to use v8. So there may be deeper problem that is causing all of this that I'm missing.
Edit:
Also, you could try to set the following parameters with gn args:
visual_studio_path = "..."
visual_studio_version = "2017"
wdk_path = "..."
windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"
To set those parameters, do:
gn args out.gn/x64.release
This will open a text editor where you can write the extra parameters you are interested in.
To see the full list of parameters you can specify:
gn args --list out.gn/x64.release
I was following this guide https://medium.com/dailyjs/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4 and also ran into the error
LINK1181: cannot open input file 'advapi32.lib'
I'm pretty sure it was because I had the wrong versions of the Windows 10 SDK. Similar to you I had versions:
Windows Kits/10/Lib/10.0.10240.0
Windows Kits/10/Lib/10.0.16299.0
But according to https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Setting-up-Windows (Which I think is relevant) you need version 10.0.15063.0
After installing version 10.0.15063.0 (with the visual studio installer) to
Windows Kits/10/Lib/10.0.15063.0
I was able to continue with the build.

Error while compiling workspace-d

I tried to install workspace-d on Windows 10 using Administrator privilege but failed.
Here is the error message.I haved installed dmd, dub and git.
PS C:\Users\U\Desktop\workspace-d-installer> .\workspace-d-installer.exe
Welcome to the workspace-d installation guide.
Make sure, you have dmd, dub and git installed.
Which external components do you want to install?
[1] DCD - auto completion
[2] DScanner - code linting
[3] dfmt - code formatting
Enter a comma separated list of numbers
Selected [all]:
Cloning workspace-d into C:\Users\U\AppData\Local\Temp\workspaced-install-635958600835730563
Checking out v2.6.0
Compiling...
Error: Error writing file '..\..\..\..\..\..\U\AppData\Roaming\dub\packages\painlesstraits-0.1.0\.dub\build\library-release-windows-x86-dmd_2071-92537C3AEFB87AC450BFCCEE2ECBED44\painlesstraits.lib'
dmd failed with exit code 1.
Error while compiling workspace-d.
This is a bug with workspace-d-installer. Even though it just runs the shell commands, it has some permission problems on windows. I have opened an issue on the project page if you want to do anything on it: https://github.com/Pure-D/workspace-d-installer/issues/2
The only solution right now is to manually clone each repository (workspace-d, dfmt, dscanner, dcd) and follow their build instructions. I'm trying to fix that issue so you can use workspace-d-installer.

wxWidgets-2.9.4\include and \lib\gcc_lib\mswu No such file or directory error on CodeBlocks

I'm trying to learn C++ programming with wxWidgets and CodeBlocks (with MinGW) and earlier today I succeeded in installing the software (after some trouble) to my Windows 7 computer with the guidance given to me in this post:
wxWidget 2.8.12 not working in Codeblocks
Later on the same day, I did the exact same steps on another Windows 7 machine and after creating a wxWidgets project and trying to compile and run it I got the following errors:
\wxWidgets-2.9.4\include: No such file or directory
\wxWidgets-2.9.4\lib\gcc_lib\mswu: No such file or directory
I have checked and these folders really do exist on those locations...so what seems to be the problem here again?...on the earlier post user asanth kumar guided me that if the steps given in the guide don't get the job done, then I'm missing an important compiler search path in my build options.
Ok, so what do I do? Where do I enter the search path? What is the search path, etc. I'm very new with wxWidgets and CodeBlocks so I don't know very much terminology. If anyone should know what to do, could you please give me like step by step instruction what to do e.g. like Click Project --> Build options --> ... and so on
I have used the latest CodeBlocks (12.11) and wxWidgets (2.9.4) installers
Thank you for any help :)
UPDATE:
here is the build log: (I'm using CodeBlocks 12.11 and wxWidgets 2.9.4)
-------------- Build: Debug in TEST (compiler: GNU GCC Compiler)---------------
windres.exe -I"C:\Users\Jonne\Omat ohjelmat\wxWidgets-2.9.4\include" -I"C:\Users\Jonne\Omat ohjelmat\wxWidgets-2.9.4\lib\gcc_lib\mswu" -J rc -O coff -i C:\Users\Jonne\DOCUME~1\CODEBL~1\TEST\resource.rc -o obj\Debug\resource.res
gcc: error: ohjelmat\wxWidgets-2.9.4\include: No such file or directory
gcc: error: ohjelmat\wxWidgets-2.9.4\lib\gcc_lib\mswu: No such file or directory
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings (0 minutes, 0 seconds)
Here is also a picture where you can see Build options, global variables and build log on my CodeBlocks:
NOTICE FUTURE READERS: Install wxWidgets to a directory without whitespace in the path name. The problems in this post was because the directory path had spaces in it
When you create a wxWidgets project.Have you did this?
File->New->Project->wxWidgets Project->Click Go->Click on Next->click on the suitable wxWidgets 2...version->click Next->Give project Name->Click on Next->Click on Next
After that the Following below Screen comes in the Wizard. Give the wxWidgets Location(Path where You installed the wxWidgets 2.9.4)
After that click on Finish.
For Environment Variable Path Setting
Follow the Below Steps:
Right click on MyComputer->Click on Advanced Systems settings->click on Environment Variables->click on New->Give variable name=Path and variable value="C:\Program Files (x86)\CodeBlocks\MinGW\bin" -> click ok
`
Try The Following Steps.It will work.
Updates about Build settings:
I am having the same problem as this and I somehow solved my problem.
I transfer my wxWidget folder to another location path that don't have white space name on it's path. For example above, "C:\Users\Jonne*Omat ohjelmat*\wxWidgets-2.9.4\include"
the path has white space between Omat ohjelmat. Try transfering it where the path contains no white spaces. For me, I put it on C:\wxWidgets-3.1.2