[vtkusers] Unresolved externals when trying to compile my VTK sample project

Dejan Zivkovic dejan.zivkovic90 at gmail.com
Sat Sep 5 16:29:33 EDT 2015


I got some unresolved externals when trying to compile my VTK sample
project in Visual Studio 2010

I did the following steps:
1) Downloaded VTK 6.3 from GIT
2) Configured it with cmake for VisualStudio 2010 x64
3) Generated a VTK solution, and made an INSTALL release build

The result was the folder VTK in C:\ProgramFiles which has *include* and
*libs* folders
that I intended to use for my solution.

Finally, I
- made an empty VS C++ project
- made a cpp files with copied sample code
- added include directories from C:\ProgramFiles\VTK\include
- set additional lib dir to C:\ProgramFiles\VTK\libs
- added all libs in the folder above to the linker input

And I get 15  unresolved externals:

1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall
vtkRenderWindowInteractor::SetRenderWindow(class vtkRenderWindow *)"
(__imp_?SetRenderWindow at vtkRenderWindowInteractor@@QAEXPAVvtkRenderWindow@
@@Z)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class vtkRenderWindowInteractor *
__cdecl vtkRenderWindowInteractor::New(void)"
(__imp_?New at vtkRenderWindowInteractor@@SAPAV1 at XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall vtkProp3D::RotateY(double)"
(__imp_?RotateY at vtkProp3D@@QAEXN at Z)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall vtkProp3D::RotateX(double)"
(__imp_?RotateX at vtkProp3D@@QAEXN at Z)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall vtkCamera::Zoom(double)"
(__imp_?Zoom at vtkCamera@@QAEXN at Z)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class vtkCylinderSource * __cdecl
vtkCylinderSource::New(void)" (__imp_?New at vtkCylinderSource@@SAPAV1 at XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class vtkRenderWindow * __cdecl
vtkRenderWindow::New(void)" (__imp_?New at vtkRenderWindow@@SAPAV1 at XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: class vtkProperty * __thiscall
vtkActor::GetProperty(void)" (__imp_?GetProperty at vtkActor
@@QAEPAVvtkProperty@@XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class vtkActor * __cdecl
vtkActor::New(void)" (__imp_?New at vtkActor@@SAPAV1 at XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class vtkPolyDataMapper * __cdecl
vtkPolyDataMapper::New(void)" (__imp_?New at vtkPolyDataMapper@@SAPAV1 at XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall
vtkRenderer::ResetCamera(void)" (__imp_?ResetCamera at vtkRenderer@@QAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: class vtkCamera * __thiscall
vtkRenderer::GetActiveCamera(void)" (__imp_?GetActiveCamera at vtkRenderer
@@QAEPAVvtkCamera@@XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __thiscall vtkRenderer::AddActor(class
vtkProp *)" (__imp_?AddActor at vtkRenderer@@QAEXPAVvtkProp@@@Z)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: static class vtkRenderer * __cdecl
vtkRenderer::New(void)" (__imp_?New at vtkRenderer@@SAPAV1 at XZ)
1>main.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: class vtkAlgorithmOutput * __thiscall
vtkAlgorithm::GetOutputPort(void)" (__imp_?GetOutputPort at vtkAlgorithm
@@QAEPAVvtkAlgorithmOutput@@XZ)
1>C:\Users\Dejan\documents\visual studio
2010\Projects\VTKTest\Release\VTKTest.exe : fatal error LNK1120: 15
unresolved externals

Can someone help? This has been bugging me for more than a day.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150905/584306dd/attachment.html>


More information about the vtkusers mailing list