Is building Blender with ‘Visual Studio Build Tools 2022’ (including the ‘Desktop Development with C++’ workload) but without the entirety of ‘Visual Studio Community 2022’ supported?
Considering the substantial size of Visual Studio, and the fact that I’m developing in VS Code, I assumed I would only require the build tools.
I have a fresh install of Windows 11, installed the development tools as per the docs (apart from the above substitution) and am running C:\Users\chris\Documents\blender-git\blender>make update. The output of that is the following:
Warning: Python not found, there is likely an issue with the library folder
No explicit msvc version requested, autodetecting version.
Compiler Detection failed. Use verbose switch for more information.
Visual Studio not found (try with the 'verbose' switch for more information)
Extra info:
python --version
Python 3.10.2
svn --version
svn, version 1.14.1-SlikSvn (SlikSvn/1.14.1)
cmake --version
cmake version 3.22.2
git --version
git version 2.34.1.windows.1
while it is supported, by default it will look for the standard version of VS. you can force it to look for the build tools by adding 2022b to all your make.bat invocations
Got it, thanks for the quick reply. As I understand, any make * command becomes make 2022b * and things should work? Seems like make 2022b update is working so far.
As I understand, any make * command becomes make 2022b * and things should work?
That is correct, given you’re clearly doing cli builds switching to ninja will likely get your some build time improvements. just install ninja somewhere in the path and use make ninja 2022b full rather than make full
Here again, this time on a new computer. I followed the same steps as before (still have the versions of the required packages downloaded) but am hitting this error:
I suspect it’s to do with a missing optional component of the VS 2022 build tools, I just don’t know which it would be. Do any of the ones I’ve got unchecked here seem like they would be required @LazyDodo?
The Command "2022b" unknown, aborting error is from our script blender-git\blender\build_files\windows\parse_arguments.cmd which is called from make.bat. Are you updated with latest master?
That seems to have completed, now I’m having issues getting cmake gui to configure things. Not really sure what needs to be checked here. I’m guessing I’d need whatever the equivalent of gcc is on Windows, but I assumed that is the VS build tools.
Selecting Windows SDK version to target Windows 10.0.19044.
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:107 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:107 (project):
No CMAKE_CXX_COMPILER could be found.
Configuring incomplete, errors occurred!
See also "F:/Users/chris/Documents/blender-dev-env/CMakeFiles/CMakeOutput.log".
See also "F:/Users/chris/Documents/blender-dev-env/CMakeFiles/CMakeError.log".
Things clearly worked in Feb, how did your branch go back in time and forget about VS 2022 by October?
When you say “it completed” does that mean you ended up with a working and build you can run?
When you say, “use cmake-gui to configure” are you setting up a new build ? or are you re-configuring the one from step 2? if so it shouldn’t be looking for compilers…
I’m setting up a new computer. I copied over the entire blender-dev-env folder including the source code and libs, because I remember last time I tried pulling all libs from scratch it took hours.
The thing that completed was make ninja 2022b update. That was after manually getting the source code up to date by using git directly.
I then tried running make ninja 2022b debug, which gave this output:
>make ninja 2022b debug
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.3.5
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
The system cannot find the file specified.
[vcvarsall.bat] Environment initialized for: 'x64'
Building blender with VS2022 for x64 in F:\Users\chris\Documents\blender-dev-env\blender\..\build_windows_x64_vc17_Debug
-- The C compiler identification is MSVC 19.33.31630.0
-- The CXX compiler identification is MSVC 19.33.31630.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: F:/Users/chris/Documents/blender-dev-env/build_windows_x64_vc17_Debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/PROGRA~1/NINJA-~1/ninja.exe cmTC_6e875 && [1/2] Building C object CMakeFiles\cmTC_6e875.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_6e875.exe
FAILED: cmTC_6e875.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_6e875.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~2\MICROS~3\2022\BUILDT~1\VC\Tools\MSVC\1433~1.316\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_6e875.dir\testCCompiler.c.obj /out:cmTC_6e875.exe /implib:cmTC_6e875.lib /pdb:cmTC_6e875.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /fo CMakeFiles\cmTC_6e875.dir/manifest.res CMakeFiles\cmTC_6e875.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specified
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:107 (project)
-- Configuring incomplete, errors occurred!
See also "F:/Users/chris/Documents/blender-dev-env/build_windows_x64_vc17_Debug/CMakeFiles/CMakeOutput.log".
See also "F:/Users/chris/Documents/blender-dev-env/build_windows_x64_vc17_Debug/CMakeFiles/CMakeError.log".
It looks like it found the compiler, so I am confused about the cmake error, but since I couldn’t really parse this error message, I wondered whether I hadn’t yet configured cmake on the new computer (and I wanted to change some options for the new computer anyway) so tried creating it. That’s when I got the output above.
Thanks for the pointers. rc.exe missing from path did indeed seem to be the issue which led me to find that the Windows 10 SDK component of the build tools is required. Once I installed that, I got debug build to pass (once I ran it with administrator privileges, I don’t remember needing to do that last time).
It output a blender.exe along with all the other files. Trying to run it gave me a The Application Failed To Start Because Its Side-by-Side Configuration is Incorrect error. Time to debug what’s going on with that.
Side note: I’m not posting these errors expecting that it’s anything other than my own stupidity getting me in these issues, but more as record keeping so that I can revisit later, and maybe others who have a similar situation might find my steps helpful.
The need to run as admin seems to be because it is building to C:\Program Files (x86)\Blender I guess I screwed up some config somewhere. That being said, starting the executable there launches, so I think the previous error was a red herring.