Trying to "Build Blender" getting error

System Information
Operating system: Windows 10

Blender Version
Broken: Honestly have no idea.
Worked: (optional)
Using visual studio 2019, latest version.

Short description of error
Activation context generation failed for “E:\blender-git\build_windows_x64_vc16_Release\bin\Release\blender.exe”. Dependent Assembly blender.crt,type=“win32”,version=“1.0.0.0” could not be found. Please use sxstrace.exe for detailed diagnosis.

Exact steps for others to reproduce the error
https://wiki.blender.org/wiki/Tools/Debugging/Python_Visual_Studio
and
https://wiki.blender.org/wiki/Building_Blender/Windows

I followed these “step-by-step” instructions (which was a nightmare, because very single step required 5 hours of troublshooting to get past)
Now I’m on the very last step “Press F5 to launch”
Which yields “Application can not start because application configuration is incorrect”.
The event viewer clarifies "
Activation context generation failed for “E:\blender-git\build_windows_x64_vc16_Release\bin\Release\blender.exe”. Dependent Assembly blender.crt,type=“win32”,version=“1.0.0.0” could not be found. Please use sxstrace.exe for detailed diagnosis."

During the “Right click install and build” part yields only 1 error, which seems irrelevant, but listing anyways:

Severity Code Description Project File Line Suppression State
Error MSB3073 The command “setlocal
“E:\Program Files\CMake\bin\cmake.exe” -DBUILD_TYPE=Release -P cmake_install.cmake
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd” exited with code 1. INSTALL C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 149

Are you able to build blender using the CMake preset (make full)?

The error provided doesn’t really tell us much other than that the initial cmake generation failed. Try running as admin and rebuilding the INSTALL project.

Also check that you’re using a supported program configuration (x64, Release/Debug) as well

from the pages you linked

Build the INSTALL target listed in the Solution Explorer .
Note: the INSTALL copies DLL’s and files used by Blender to the build directory so blender.exe can start.
If you skip this step running blender.exe will fail to start, reporting missing DLL files.

if there are any further errors please paste a full build log and i’ll happily take a look

I found an install.log file under (Build directory)\x64\Release\INSTALL that said
Cannot access “C:\Program Files (x86)\Blender\blender.crt\msvcp140.dll” Permission denied.
Unfortunately, it’s not as simple as R-clicking the .sln and “run as admin”. However, can run Visual studio 2019 as admin and load “solution”. (I hadn’t tried this before because Visual Studio layout if different with the solution loaded. I was thinking the build had custom built portions of Studio as well.)
Trying now, will reply if works. :slight_smile:

Didn’t work. No errors during build this time. No errors in build log. Only error is in event viewer:
Dependent Assembly blender.crt,type=“win32”,version=“1.0.0.0” could not be found. Please use sxstrace.exe for detailed diagnosis."
Ran as admin, R-Click install and clean, R-click install and rebuild.

Can’t upload log file “New users can’t attach files” No errors.
If this isn’t the log file you need, please tell me the location of the one you need. Thanks.
Install.log:
https://pastebin.com/zqhuHL5f
It’s really strange to get any errors about “Win32” considering I’m installing x64…

There is no “make full”. There is an “All_Build”. However, “Install” has a reference link that runs “All_build” and “Zero_Check” as well.
It’s set to “Release” and “X64” as desired.
And the Green Arrow is set to “Python/Native Debugging”.

I’ve ran as admin, see above. If there are any log files that would be helpful, please specify name and directory location. Thanks.

oh no, blender is not supposed to install to program files, no wonder you are getting a permission denied error. By default installs into the build folder unless something is seriously wrong, i’m unsure how you configured your build but something is seriously wonky.

can you try running make full in the blender source folder (make.bat is in that folder) from the cmd.exe command prompt, no administrator privileges needed.

and if that doesn’t succeed paste any error messages it outputs

Results of “Make Full”

https://pastebin.com/Uy8TNa54

can you check your E:\blender-git\build_windows_Full_x64_vc16_Release\CMakeCache.txt file and see what the prefix path is set to?

should be set to

CMAKE_INSTALL_PREFIX:PATH=E:/blender-git/build_windows_Full_x64_vc16_Release/bin/${BUILD_TYPE}
2 Likes

//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/Blender
I’ll change and see what happens.

Thanks. That was the final piece to getting it built.
So, now I just need to figure out how the debugger works. -_- When I add breakpoints I get “no symbols have been loaded for this document”. This suggests the .py file isn’t the active file blender is executing. You wouldn’t happen to know how to add breakpoints to the blender python script currently being written, would you?

The Debug->Windows->Modules window should list all loaded modules including .py files, i’d check that the file you are trying to debug is in there.

Yes, the file is listed as E:\Blender\My Blend Files\Building Generator.blend\BuildingGenerator.py.
It’s listed the .blend as a folder. I can’t, for the life of me, figure out how to open the .py file within “.blend” folder. :frowning:
I see how to load it if it’s an addon, but not if it’s only part of the blend file.

I have to admit, i’ve only used it with .py files that actually exist on the filesystem, not embedded ones.

we’re in uncharted territory here, i’m gonna have to take a look this weekend.

1 Like

Way more help than I was expecting! Much love for the Blender community.
I’m building a “Random building” generator in python, over 1000 lines of script so far. Eventually, I’ll scale it up to “Build city” and “Build planet”. Photorealistic, hyper detailed, top to bottom. :slight_smile:
Bit of a challenge, since I’m brand new to both Blender and Python. :wink:

I gave it a quick shake, the VS debugger will only pick up on files actually existing on the file-system, so I wrote a quick hack to write a .py to the temp folder when it compiles the script , but then you end up with a chicken and egg situation, you can’t set a break point until the code is compiled, and by the time the file exists on the file system the code has already executed…

so yeah debugging embedded python in a .blend file is unlikely to happen, stick to actual files if you need the debugger.

Thank you so much for trying. I only need the debugger for the script I’m writing that requires assets in blender to work.
From looking at the setup, if I need the debugger in a dire situation, I can convert the script to an addon and load it. This’ll give me access to the .py within the addon to set breakpoints. Not ideal, but should be functional in a worst case scenario.

Thank you! VS 2022 with Blender 3.2

sidebyside missing blender.crt repaired when I changed the install path and installed.