Long list of linking errors related to compiling Cycles

Hello!

I’m attempting to compile Blender for Windows, and the instructions seem dead simple, yet the build consistantly fails when it gets to the point where it has to compile/link the parts of the program related to Cycles, specifically OpenImageIO. The instructions say that “make update,” is responsible for downloading all the necessary dependencies and seems to be running fine, so if the library is missing I’m not sure what’s causing it.

I’ve compile Blender once before a few years ago (post 2.8) and it worked fine, so I’m not sure what’s changed since then.

Here’s the build log:
Build.txt (573.4 KB)

Your old build folder likely has a bunch of old libraries referenced, i’d start by removing your E:/blender-git/build_windows_x64_vc16_Release/ folder and retrying, if that doesn’t do the trick, the output of make showhash run in your source folder would be helpful in diagnosing this.

Thanks for your response, but unfortunately the issue persists. I even tried deleting everything and starting from scratch, but same issue.

Here’s the output of showhash

E:\blender-git\blender>make showhash
Branch_name=main
Branch_hash=81a6eb211892740b5c8124460572663391e54598
Addons_Branch_name=main
Addons_Branch_hash=b42d68627734cb18af0e6f41537063984313a284
Libs_Branch_name=HEAD
Libs_Branch_hash=62613b29fd2eb0d8ca84d86e6e57c0aa11548460

Can you attach your E:/blender-git/build_windows_x64_vc16_Release/CMakeCache.txt file?

Sure, here you go:

CMakeCache.txt (133.7 KB)

Hate to say it, but this all seems to check out, removing your build folder should have worked.

There is a mix of OpenImageIO_v2_5 and OpenImageIO_v2_4 symbols, which shouldn’t happen.

Maybe there is another OpenImageIO version interfering, like from vcpkg? Or the lib folder is somehow containing old files?

could be vcpkg, for most/all of blender we disable vcpkg for msbuild based projects, by setting calling

set_target_properties([target_name_here] PROPERTIES VS_GLOBAL_VcpkgEnabled "false")

but i gotta admit, unsure if that extends to cycles…

@ZachHixson can you try the following patch?

diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake
index caa10a3a5d5..98346f00d47 100644
--- a/intern/cycles/cmake/macros.cmake
+++ b/intern/cycles/cmake/macros.cmake
@@ -12,7 +12,7 @@ endfunction()

 macro(cycles_add_library target library_deps)
   add_library(${target} ${ARGN})
-
+  set_target_properties(${target} PROPERTIES VS_GLOBAL_VcpkgEnabled "false")
   # On Windows certain libraries have two sets of binaries: one for debug builds and one for
   # release builds. The root of this requirement goes into ABI, I believe, but that's outside
   # of a scope of this comment.

Awesome! That seems to have worked, thanks!

Do you think this will become an official commit, or will I likely have to apply this patch any time I build Blender (assuming I’m starting from scratch)?

We’ll land it so you don’t have to apply it your self, I just wanted to know if it worked before doing that :slight_smile: