VTK failed to build on Windows due to the error LNK2019: unresolved external symbol
Hi,
I tried to build VTK with VS2017 update 2 on Windows. It failed due to the error LNK2019: unresolved external symbol. This issue can be reproduced from master revision 1ac7519a. Could you please help take a look at this? Thanks!
The repro steps are as follows:
- git clone https://gitlab.kitware.com/vtk/vtk.git D:\VTK\src
- Open a VS 2017 x86 command prompt and browse to D:\VTK
- mkdir build_x86 && pushd build_x86
- cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.15063.0 -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DBUILD_EXAMPLES=OFF -DVTK_IGNORE_CMAKE_CXX11_CHECKS=TRUE ..\src"
- msbuild /m /p:Configuration=Release;Platform=Win32 All_BUILD.vcxproj /t:Rebuild"
Error information:
"D:\VTK\build_x86\All_BUILD.vcxproj" (Rebuild target) (1) ->
"D:\VTK\build_x86\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj" (default target) (171:2) ->
vtkIOCore-9.0.lib(vtkLZMADataCompressor.obj) : error LNK2019: unresolved external symbol __imp__lzma_easy_buffer_encode referenced in function "protected: virtual unsigned int __thiscall vtkLZMADataCompressor::CompressBuffer(unsigned char const *,unsigned int,unsigned char *,unsigned int)" (?CompressBuffer@vtkLZMADataCompressor@@MAEIPBEIPAEI@Z) [D:\VTK\build_x86\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj]
vtkIOCore-9.0.lib(vtkLZMADataCompressor.obj) : error LNK2019: unresolved external symbol __imp__lzma_stream_buffer_decode referenced in function "protected: virtual unsigned int __thiscall vtkLZMADataCompressor::UncompressBuffer(unsigned char const *,unsigned int,unsigned char *,unsigned int)" (?UncompressBuffer@vtkLZMADataCompressor@@MAEIPBEIPAEI@Z) [D:\VTK\build_x86\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj]
D:\VTK\build_x86\bin\Release\vtkInteractionWidgetsCxxTests.exe : fatal error LNK1120: 2 unresolved externals [D:\VTK\build_x86\Interaction\Widgets\Testing\Cxx\vtkInteractionWidgetsCxxTests.vcxproj]
Edited by Ben Boeckel