Build failed: inflate_fast referenced (zlib issue via assimp lib)
jfbourdon opened this issue · 5 comments
I succeded building CloudCompare alone, but the building process stops rapidly when adding MeshIO throwing codes LNK2019, LNK2001, LNK1120 and MSB3073. Here is the output of Visual Studio 15 2017 x64:
1>------ Build started: Project: translations, Configuration: Release x64 ------
2>------ Build started: Project: translations_fr, Configuration: Release x64 ------
3>------ Build started: Project: translations_ja, Configuration: Release x64 ------
4>------ Build started: Project: translations_ru, Configuration: Release x64 ------
5>------ Build started: Project: zlib, Configuration: Release x64 ------
6>------ Build started: Project: MeshIO, Configuration: Release x64 ------
5>Automatic MOC for target zlib
5> Creating library D:/bouj1a/CCbuild/plugins/3rdParty/MeshIO-master/extern/assimp/contrib/zlib/Release/zlib.lib and object D:/bouj1a/CCbuild/plugins/3rdParty/MeshIO-master/extern/assimp/contrib/zlib/Release/zlib.exp
6>Automatic MOC for target MeshIO
5>inflate.obj : error LNK2019: unresolved external symbol inflate_fast referenced in function inflate
5>infback.obj : error LNK2001: unresolved external symbol inflate_fast
5>D:\bouj1a\CCbuild\plugins\3rdParty\MeshIO-master\extern\assimp\contrib\zlib\Release\zlib.dll : fatal error LNK1120: 1 unresolved externals
5>Done building project "zlib.vcxproj" -- FAILED.
6> Creating library D:/bouj1a/CCbuild/plugins/3rdParty/MeshIO-master/Release/MeshIO.lib and object D:/bouj1a/CCbuild/plugins/3rdParty/MeshIO-master/Release/MeshIO.exp
6>zlibstatic.lib(inflate.obj) : error LNK2019: unresolved external symbol inflate_fast referenced in function inflate
6>D:\bouj1a\CCbuild\plugins\3rdParty\MeshIO-master\Release\MeshIO.dll : fatal error LNK1120: 1 unresolved externals
6>Done building project "MeshIO.vcxproj" -- FAILED.
7>------ Build started: Project: INSTALL, Configuration: Release x64 ------
7>-- Install configuration: "Release"
7>-- Installing: D:/bouj1a/cmake_install_prefix/CloudCompare/CC_CORE_LIB.dll
7>-- Installing: D:/bouj1a/cmake_install_prefix/ccViewer/CC_CORE_LIB.dll
7>-- Installing: D:/bouj1a/cmake_install_prefix/CloudCompare/QCC_DB_LIB.dll
7>-- Installing: D:/bouj1a/cmake_install_prefix/ccViewer/QCC_DB_LIB.dll
7>-- Installing: D:/bouj1a/cmake_install_prefix/CloudCompare/QCC_IO_LIB.dll
7>-- Installing: D:/bouj1a/cmake_install_prefix/ccViewer/QCC_IO_LIB.dll
7>CMake Error at plugins/3rdParty/MeshIO-master/cmake_install.cmake:37 (file):
7> file INSTALL cannot find
7> "D:/bouj1a/CCbuild/plugins/3rdParty/MeshIO-master/Release/MeshIO.dll".
7>Call Stack (most recent call first):
7> plugins/3rdParty/cmake_install.cmake:37 (include)
7> plugins/cmake_install.cmake:39 (include)
7> cmake_install.cmake:43 (include)
7>
7>
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: The command "setlocal
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmEnd
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmErrorLevel
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: exit /b %1
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmDone
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
7>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :VCEnd" exited with code 1.
7>Done building project "INSTALL.vcxproj" -- FAILED.
========== Build: 4 succeeded, 3 failed, 13 up-to-date, 0 skipped ==========
This is an assimp build problem with zlib. The relevant error is:
inflate.obj : error LNK2019: unresolved external symbol inflate_fast referenced in function inflate
infback.obj : error LNK2001: unresolved external symbol inflate_fast
Looks like this issue. Kim said he fixed it a while ago, but I'm using the latest assimp master...
There is a more complete discussion of the problem on StackOverflow.
Do you know if your build is AMD64? (I don't have Windows set up to figure out how to check that - is your processor an AMD?)
The problem was with the AMD64 build option. Without it, the building process goes smoothly.
Thanks for letting me know.
Did you enable the AMD64
option yourself or was it automatically enabled?
It wasn't enabled by default. I enabled it thinking that it was needed to get a x64 build of CC.
Ok - thank you.
I see that it's a "naked" cmake option - no indication where it's from - so it's confusing. Would be better had they named it ZLIB_AMD64
.
I'll figure out something to either disable or warn about this.