Need for help. There are some errors when I built the VTK8.2.0 using MingG64.

I selected the option “BUILD_SHAREED_LIBS”, cmake is ok, but errors appeared like this during compling:

In file included from E:\shot\VTK\VTK-8.2.0_src\Domains\Chemistry\vtkSimpleBondPerceiver.cxx:26:
E:/shot/VTK/VTK-8.2.0_src/Common/DataModel/vtkPolyData.h:691:22: warning: ‘unsigned char vtkPolyData::GetCellPoints(vtkIdType, vtkIdType&, vtkIdType*&)’ redeclared without dllimport attribute after being referenced with dll linkage
inline unsigned char vtkPolyData::GetCellPoints(
CMakeFiles\vtkglew.dir/objects.a(glew.c.obj):glew.c:(.text+0x14897): undefined reference to memset' CMakeFiles\vtkglew.dir/objects.a(glew.c.obj):glew.c:(.text+0x1c3b0): undefined reference tomemset’
CMakeFiles\vtkglew.dir/objects.a(glew.c.obj):glew.c:(.text+0x1c4d1): undefined reference to `memset’
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [ThirdParty\glew\vtkglew\CMakeFiles\vtkglew.dir\build.make:86: bin/libvtkglew-8.2.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2400: ThirdParty/glew/vtkglew/CMakeFiles/vtkglew.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2

                                       Could someone can help me?
1 Like

I have solved this problem. Find and open the file: E:\shot\VTK\vtk-bin\ThirdParty\glew\vtkglew\CMakeFiles\vtkglew.dir\flag.make. Add “-minline-all-stringops” option at the end of the C_FLAGS line. remake the project.

The reference URL:


Fix worked for me, too. Out of curiosity, how did you figure this solution out?