Windows 10 compile error C2280

Hello,

Complete newby here. Trying to build current ToT on Windows 10, I get compile errors like this:

C:\Users\Andrew\blender-all\blender\source\blender\nodes\geometry\nodes\node_geo_align_rotation_to_vector.cc(147): error C2280: 'OutputAttributePtr::OutputAttributePtr(const OutputAttributePtr &)': attempting to reference a deleted functionnode_geo_attribute_randomize.cc [C:\Users\Andrew\blender-all\build_windows_x64_vc15_Release\source\blender\nodes\bf_nodes.vcxproj]
  
C:\Users\Andrew\blender-all\blender\source\blender\nodes\geometry\nodes\node_geo_attribute_color_ramp.cc(77): error C2280: 'OutputAttributePtr::OutputAttributePtr(const OutputAttributePtr &)': attempting to reference a deleted functionnode_geo_attribute_remove.cc [C:\Users\Andrew\blender-all\build_windows_x64_vc15_Release\source\blender\nodes\bf_nodes.vcxproj]
  C:\Users\Andrew\blender-all\blender\source\blender\blenkernel\BKE_geometry_set.hh(110): note: compiler has generated 'OutputAttributePtr::OutputAttributePtr' here
  C:\Users\Andrew\blender-all\blender\source\blender\blenkernel\BKE_geometry_set.hh(110): note: compiler has generated 'OutputAttributePtr::OutputAttributePtr' hereC:\Users\Andrew\blender-all\blender\source\blender\nodes\geometry\nodes\node_geo_attribute_math.cc(231): error C2280: 'OutputAttributePtr::OutputAttributePtr(const OutputAttributePtr &)': attempting to reference a deleted function

… etc.

This is using d3cb1d845b347524bcadff2f5e481b7aec95f3af and
Microsoft Visual Studio Community 2019 Version 16.9.3

The error makes no sense to me, since the line assigns value from a temporary:

OutputAttributePtr attribute = component.attribute_try_get_for_output(
      attribute_name, result_domain, data_type);

Is my Visual Studio misconfigured somehow?

Thanks!

seems ok here, what is the output of git status and git diff when ran in the source folder?

This is literally my first attempt at building. I have no local changes.

C:\Users\Andrew\blender-all\blender>git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

C:\Users\Andrew\blender-all\blender>git diff

C:\Users\Andrew\blender-all\blender>

The C:\Users\Andrew\blender-all\build_windows_x64_vc15_Release is a hint. When configuring for vs2019, you should see a vc16 in that folder name.

When you ran, make.bat, what parameters did you use and did you use a raw cmd window or one of the visual studio cmd environments?

I’ve build with both 2017- v15.9.18 and 2019- v16.9.0 can’t seem to repro the issue sadly.

I was building from “plain cmd” window (not one with VC environment set up).
I had both Visual Studio Community 2017 and 2019 installed. I removed the former.

I invoke the make.bat with no arguments. Here is what it prints:

C:\Users\Andrew\blender-all\blender>make
No explicit msvc version requested, autodetecting version.
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.9.3
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Compiler Detection successful, detected VS2019
Building blender with VS2019 for x64 in C:\Users\Andrew\blender-all\blender\..\build_windows_x64_vc16_Release
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.28.29913.0
-- The CXX compiler identification is MSVC 19.28.29913.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.31.1.windows.1")
-- Performing Test SUPPORT_NEON_BUILD
-- Performing Test SUPPORT_NEON_BUILD - Failed
-- Performing Test SUPPORT_SSE_BUILD
-- Performing Test SUPPORT_SSE_BUILD - Success
-- Performing Test SUPPORT_SSE2_BUILD
-- Performing Test SUPPORT_SSE2_BUILD - Success
-- 64 bit compiler detected.
-- Visual Studio 2019 detected.
-- SSE2 SIMD instructions enabled
-- Found OpenGL: opengl32
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- Tests: Using Python executable: C:/Users/Andrew/blender-all/build_windows_x64_vc16_Release/bin/$<CONFIG>/2.93/python/bin/python$<$<CONFIG:Debug>:_d>
-- Disabling render tests because tests folder does not exist at C:/Users/Andrew/blender-all/blender/../lib/tests
-- C Compiler:   "MSVC"
-- C++ Compiler: "MSVC"
...

And I now get v16.

This build still fails, but at least with an error I can understand:

C:\Users\Andrew\blender-all\blender\source\blender\blenlib\BLI_math_mpq.hh(34,12): fatal error C1083: Cannot open include file: 'gmpxx.h': No such file or directory (compiling source file C:\Users\Andrew\blender-all\blender\source\blender\nodes\geometry\nodes\node_geo_boolean.cc)

And after adding C:\Users\Andrew\blender-all\lib\win64_vc15\gmp\include to bf_nodes.vcproj, I have a successful build.

Thanks for the help!