Windows lib changes Nov 2019

All,

Since the beginning of time we have always used a weird mix of using the static C runtime for some
parts of blender while using the dynamic runtime for others.

No-one exactly remembers how this came to be, but what was clear that mixing runtimes is ‘not great’
and that it eventually would cause issues, which it recently did [1]

Today I’m cleaning it up and switching blender over to the dynamic runtime on windows.

Now sadly this requires a whole new library set so if you are building blender on windows you may
have some hiccups and unfortunately a large download.

Ideally you’d run ‘make update’ twice and it will sort it self out. (Once to get the updated make.bat
that knows about the new libs, and a second time to actually grab them)

However there are some side cases where people did not follow our building guide and/or systems
where cmake just behaved oddly, so here is a list of oddities you may run into and how to resolve them.

  1. I get a build error along the lines of:
Windows requires pre-compiled libs at: 'c:/blender-git/blender/../lib/win64_vc15'.
Please run make update in the blender source folder to obtain them.

Solution:

Do what it says, if make update does not work for you, see 2

  1. I checked out the libraries my self, I don’t have SVN
    in my path and/or “make update” does not work for me.

It happens, not everybody is following our building instructions for various reasons, and some environments just don’t seem to play nice with our scripts.

Solution:

You can check out the new set of libraries manually from

https://svn.blender.org/svnroot/bf-blender/trunk/lib/win64_vc15

just make sure they and up in the next to the win64_vc14 folder you currently have and it should work.

  1. I have a linker error mentioning a RuntimeLibrary mismatch

These generally come in the form of:

'RuntimeLibrary': value 'MTd_StaticRelease' doesn't match value 'MDd_DynamicRelease' in [somefile]

This seems to be coming from CMake not always picking up on changes in the platform settings.

Solution:

Remove your build folder and start a fresh build

  1. MSVC 2015

MSVC2015 has been superseded by 2 newer versions both available for free, 2015 support will be dialed back to the same level as 32 bit support. We don’t test it nor supply libraries for it anymore, however if you have your own set of libraries and have patches that help with vs2015 specific issues you are always welcome to submit those.

Solution: Update to vs2017 or vs2019

  1. I have a branch that has not merged this change yet.

That’s OK, the static vc14 libraries will be available for some time. However no further updates will be done to them.

  1. I build with VS2017 and have a linker error about __std_swap_ranges_trivially_swappable_noalias

Solution: The libs were build with msvc 2017 15.9 the version you are using is older than that, re-run the vs2017 installer and let it update to the latest version.

Special acknowledgments:

Thanks to @Harleya and @deadpin on chat for helping test so we could have an as smooth as possible transition to the new libs.

10 Likes

i uninstalled vs2017 and installed 2019 (not sure if i was supposed to do that) deleted the build folder and started a fresh build, on make full i am getting a “configuration failed”
here’s all the text
> C:\blender-2.8-git\blender>make full

No explicit msvc version requested, autodetecting version.


** Visual Studio 2019 Developer Command Prompt v16.3.8
** Copyright © 2019 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: ‘x64’
Compiler Detection successful, detected VS2019
Building blender with VS2019 for x64 in C:\blender-2.8-git\blender…\build_windows_Full_x64_vc16_Release
CMake Error: Could not create named generator Visual Studio 16 2019

Generators
Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
Optional [arch] can be “Win64” or “ARM”.
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Optional [arch] can be “Win64” or “ARM”.
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
Optional [arch] can be “Win64” or “ARM”.
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
Optional [arch] can be “Win64” or “ARM”.
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
Optional [arch] can be “Win64” or “IA64”.
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
Optional [arch] can be “Win64” or “IA64”.
Borland Makefiles = Generates Borland makefiles.
NMake Makefiles = Generates NMake makefiles.
NMake Makefiles JOM = Generates JOM makefiles.
Green Hills MULTI = Generates Green Hills MULTI files
(experimental, work-in-progress).
MSYS Makefiles = Generates MSYS makefiles.
MinGW Makefiles = Generates a make file for use with
mingw32-make.
Unix Makefiles = Generates standard UNIX makefiles.
Ninja = Generates build.ninja files.
Watcom WMake = Generates Watcom WMake makefiles.
CodeBlocks - MinGW Makefiles = Generates CodeBlocks project files.
CodeBlocks - NMake Makefiles = Generates CodeBlocks project files.
CodeBlocks - NMake Makefiles JOM
= Generates CodeBlocks project files.
CodeBlocks - Ninja = Generates CodeBlocks project files.
CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
CodeLite - MinGW Makefiles = Generates CodeLite project files.
CodeLite - NMake Makefiles = Generates CodeLite project files.
CodeLite - Ninja = Generates CodeLite project files.
CodeLite - Unix Makefiles = Generates CodeLite project files.
Sublime Text 2 - MinGW Makefiles
= Generates Sublime Text 2 project files.
Sublime Text 2 - NMake Makefiles
= Generates Sublime Text 2 project files.
Sublime Text 2 - Ninja = Generates Sublime Text 2 project files.
Sublime Text 2 - Unix Makefiles
= Generates Sublime Text 2 project files.
Kate - MinGW Makefiles = Generates Kate project files.
Kate - NMake Makefiles = Generates Kate project files.
Kate - Ninja = Generates Kate project files.
Kate - Unix Makefiles = Generates Kate project files.
Eclipse CDT4 - NMake Makefiles
= Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - MinGW Makefiles
= Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files.
Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

“Configuration Failed”

Edit: NEvermind , updated the rest of the stuff, silksvn, git, and cmake and now seems to work fine.

1 Like

Well, took all day ,but finally got the new libs downloaded. Do we still need to keep the ones in the win64_vc14 folder or can I delete them?

If you wanted to build the 2.81 branch, or other ones that haven’t been merged with master yet, then you need to keep them.

Outdated cmake was the culprit there.

1 Like

Yo @LazyDodo i wanted to bring the conversation here, as i said in the email it builds well in Visual studio community 2019 but with 2017 i m still getting errors, this time it is with cmake 3.16.0 i have already update git as well.
Here is the error message from cmake

Do have any idea how to solve it?

The error seems pretty clear to me? you’re using cmake to configure a 32 bit build while it may still build, we are no longer shipping libs for it.

You’d probably want to tell cmake to get you a 64 bit build. (You’ll have to remove your build folder for that, once a project style has been chosen for a folder this cannot be changed)

I did figure out when playing with Cmake but now i m having another fail in the msvc here is the txt in my google drive ( pasteall has been cashing) https://drive.google.com/open?id=1v_WpnSMq5FLpFShjbqE1qhWbK-7-Upr9
Any help will be appreciated :slight_smile:

The error you have is #6 in the opening post, update your Visual studio 2017 to the latest version.

svn: E170013: Unable to connect to a repository at URL ‘https://svn.blender.org/svnroot/bf-blender/trunk/lib/win64_vc15

I get this error though, is it down?.

no issues here, perhaps it was a temporary hickup or a firewall local to you that is preventing the connection?

1 Like

I did everything yesterday & it worked fine so it’s probably a hickup or an ISP problem, i’ll wait then & try later.

I will just let it be and use version 2019 from now on :slight_smile:

Guys, can anybody help me to build 2.79.6?
Branch blender2.7, commit hash 78d4e0fbf2c4
Cmake wants to download win64_vc14 libs, but ends up with the download error and I am not able to fool it with any other versions I got from other sources :frowning:, it throws some configuration errors…
Sorry, I am noob with this stuff, I just need to apply some unofficial patch to this specific version and build it.
Thank you for the help!

You’ll have to manually grab the right libraries from svn, the are available at

https://svn.blender.org/svnroot/bf-blender/tags/blender-2.79a-release/lib/win64_vc14/

First I grabbed 2.79-release libs, this got me error of Python version, so I manually placed the newer files (3.6 instead of 3.4) from 2.8 there… then it started to compile, but I got a lot of “timeval” errors there, ending up with failed build.
Now compiling using 2.80 libs https://svn.blender.org/svnroot/bf-blender/tags/blender-2.80-release/lib/win64_vc14/ … and so far it looks promising, so fingers crossed! Otherwise I am hopeless …
Thanks