Page MenuHome

We failed to build Blender on x86 due to error LNK2005: _log2 already defined in libucrt.lib with MSVC.
Closed, ResolvedPublic

Description

We failed to build Blender on x86 due to error LNK2005: _log2 already defined in libucrt.lib with MSVC. This issue can be reproduced on d217b23 commit. Could you please help take a look at this? Thank you!

Environment:
Windows + VS2017

Steps to Reproduce:
1.git clone git://git.blender.org/blender.git D:\Blender\src
2.Open a VS 2017 x86 command prompt and browse to D:\Blender
3.mkdir build_x86 && pushd build_x86
4.cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DWITH_GTESTS=1 -DWITH_CYCLES=0 -DWITH_CYCLES_OPENSUBDIV=0 -DWITH_CYCLES_OSL=0 -DWITH_PYTHON_INSTALL=0 -DWITH_PYTHON_INSTALL_NUMPY=0 ..\src
5.popd
6.msbuild /p:Configuration=Release;Platform=Win32 build_x86\Blender.sln

Actual result:
OpenColorIO.lib(MatrixTransform.obj) : error LNK2005: _log2 already defined in libucrt.lib(log2d.obj) [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]
OpenColorIO.lib(Config.obj) : error LNK2005: _log2 already defined in libucrt.lib(log2d.obj) [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]
OpenColorIO.lib(Processor.obj) : error LNK2005: _log2 already defined in libucrt.lib(log2d.obj) [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]
OpenColorIO.lib(GpuShaderDesc.obj) : error LNK2005: _log2 already defined in libucrt.lib(log2d.obj) [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]
OpenColorIO.lib(Transform.obj) : error LNK2005: _log2 already defined in libucrt.lib(log2d.obj) [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]
OpenColorIO.lib(ExponentOps.obj) : error LNK2005: _log2 already defined in libucrt.lib(log2d.obj) [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]
......
D:\Blender\build_x86\bin\tests\Release\bmesh_core_test.exe : fatal error LNK1169: one or more multiply defined symbols found [D:\Blender\build_x86\tests\gtests\bmesh\bmesh_core_test.vcxproj]