Link error, Master, Build windows 10

Hi there,

tried to build the master branch, Release 64 bit on Windows 10 ,VS2017.

Failed on building INSTALL project:

Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol “__declspec(dllimport) public: static class std::basic_string<char,struct std::char_traits,class std::allocator > __cdecl openvdb::v7_0::io::DelayedLoadMetadata::staticTypeName(void)” (_imp?staticTypeName@DelayedLoadMetadata@io@v7_0@openvdb@@SA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function “public: class std::shared_ptr __cdecl openvdb::v7_0::MetaMap::getMetadata(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (??$getMetadata@VDelayedLoadMetadata@io@v7_0@openvdb@@@MetaMap@v7_0@openvdb@@QEAA?AV?$shared_ptr@VDelayedLoadMetadata@io@v7_0@openvdb@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@@Z) blender D:\Projekte\Blender\Blender-283\build_windows_Full_x64_vc15_Release\source\creator\bf_intern_mantaflow.lib(MANTA_main.obj) 1

Also error for cmake:

Severity Code Description Project File Line Suppression State
Error MSB3073 The command “setlocal
“C:\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\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets 138

Any hints?
Bye
Jay

Be sure your VS2017 is up to date the libraries are build with 15.9.18

Ok, will check for updates

Nope, same error. cmake is 3.16.2.

can repro, will take a quick look

Ok, currently bulding with 2019, will tell you then if this works.

Ok, same with VS 2019, same project and file manta_main.obj. But bf_intern_manta compiles, just can’t be linked. Openvdb again? Feels like boost and openvdb dont match?

yeah i got it, will commit a fix in a few minutes

Ok, what was it? And why does it build on the build server, just interested.

bad commit from after the bot build, intern\mantaflow\CMakeLists.txt is missing a

add_definitions(-DOPENVDB_STATICLIB)

so it’s trying to dynamically link openvdb and given our libs are static, the linker is not having a super good time with that.

If you need to buld right now, just manually add it, commit to fix it may take a little longer since i need to check if 2.82 is affected as well.

Ok thx, I added it manually and works, built with VS 2019 now.

BTW: Just browsed the code online and 2.82 seems to have the same issue.

Both master and 2.82 have received their fixes, thanks for the report!

No problem, thx for the fix!