# visual studio - vtk 8.9 lnk2019 vtkvolume setproperty unresolve external symbol

**URL:** https://discourse.vtk.org/t/visual-studio-vtk-8-9-lnk2019-vtkvolume-setproperty-unresolve-external-symbol/819
**Category:** Support
**Created:** [April 23, 2019, 2:29pm UTC](https://discourse.vtk.org/t/visual-studio-vtk-8-9-lnk2019-vtkvolume-setproperty-unresolve-external-symbol/819 "2019-04-23T14:29:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Kmilo9999](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@Kmilo9999](https://discourse.vtk.org/u/Kmilo9999)
#### Post date: [April 23, 2019, 2:29pm UTC](https://discourse.vtk.org/t/visual-studio-vtk-8-9-lnk2019-vtkvolume-setproperty-unresolve-external-symbol/819/1 "2019-04-23T14:29:47Z")

</div>

Hello,

I’m trying to render volume data using c++ / vs2015 / vtk master (I cloned it from github and built it in vs2015), but I’m getting a linker error when calling the method vtkVolume::SetProperty  
These are the lines of code I’m using:

```
#include <vtkVolume.h>
#include <vtkVolumeProperty.h>
#include <vtkPiecewiseFunction.h>
#include <vtkColorTransferFunction.h> 
#include <vtkProperty.h> 
..
..
..
vtkSmartPointer<vtkVolumeProperty> volumeProperty = vtkSmartPointer<vtkVolumeProperty>::New();
volumeProperty->SetInterpolationTypeToLinear();
 volumeProperty->SetIndependentComponents(true);
vtkSmartPointer<vtkColorTransferFunction> colorFun = vtkSmartPointer<vtkColorTransferFunction>::New();
  volumeProperty->SetColor(colorFun);
vtkSmartPointer<vtkVolume> volume = vtkSmartPointer<vtkVolume>::New()
volume->SetProperty(volumeProperty);

```

The compiler error is  
Main.obj : error LNK2019: unresolved external symbol “\_\_declspec(dllimport) public: void \_\_cdecl vtkVolume:: **SetProperty** (class vtkVolumeProperty \*)” (\__imp_?SetPropertyvtkVolumeQEAAXPEAVvtkVolumePropertyZ) referenced in function “public: virtual void \_\_cdecl MyVRApp::onRenderGraphicsContext(class MinVR::VRGraphicsState const &)” (?onRenderGraphicsContextMyVRAppUEAAXAEBVVRGraphicsStateMinVRZ)

Yes! I added the libraries to the vs linker (properties-\>linker-\>input and properties-\>linker-\>Additional Library Directories).  
This is the log from the linker in verbose mode. I believe vtkvolume is in the vtkRenderingCore lib, but you’ll see although the linker finds it, it doesnt find the mentioned method:

Searching C:\Program Files\VTK\lib\vtkRenderingCore-8.90d.lib:  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkProp3D::SetUserTransform(class vtkLinearTransform \*)” (\__imp_?SetUserTransform:vtkProp3DQEAAXPEAVvtkLinearTransformZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: static class vtkVolume \* \_\_cdecl vtkVolume::New(void)” (\__imp_?NewvtkVolumeSAPEAV1XZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkVolume::SetMapper(class vtkAbstractVolumeMapper \*)” (\__imp_?SetMappervtkVolumeQEAAXPEAVvtkAbstractVolumeMapperZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: static class vtkRenderer \* \_\_cdecl vtkRenderer::New(void)” (\__imp_?New:vtkRendererSAPEAV1XZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkRenderer::AddVolume(class vtkProp \*)” (\__imp_?AddVolume:vtkRendererQEAAXPEAVvtkPropZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkRenderer::SetActiveCamera(class vtkCamera \*)” (\__imp_?SetActiveCameravtkRendererQEAAXPEAVvtkCameraZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: class vtkCamera \* \_\_cdecl vtkRenderer::GetActiveCamera(void)” (\__imp_?GetActiveCamera:vtkRendererQEAAPEAVvtkCameraXZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: static class vtkVolumeProperty \* \_\_cdecl vtkVolumeProperty::New(void)” (\__imp_?New:vtkVolumeProperty:SAPEAV1:XZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkVolumeProperty::SetInterpolationTypeToLinear(void)” (\__imp_?SetInterpolationTypeToLinear:vtkVolumePropertyQEAAXXZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkVolumeProperty::SetColor(class vtkColorTransferFunction \*)” (\__imp_?SetColorvtkVolumeProperty:QEAAXPEAVvtkColorTransferFunction:Z)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkVolumeProperty::SetScalarOpacity(class vtkPiecewiseFunction \*)” (\__imp_?SetScalarOpacity:vtkVolumePropertyQEAAXPEAVvtkPiecewiseFunctionZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: static class vtkColorTransferFunction \* \_\_cdecl vtkColorTransferFunction::New(void)” (\__imp_?NewvtkColorTransferFunctionSAPEAV1XZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found “\_\_declspec(dllimport) public: void \_\_cdecl vtkColorTransferFunction::AddRGBSegment(double,double,double,double,double,double,double,double)” (\__imp_?AddRGBSegment:vtkColorTransferFunctionQEAAXNNNNNNNNZ)  
Referenced in Main.obj  
Loaded vtkRenderingCore-8.90d.lib(vtkRenderingCore-8.90d.dll)  
Found \_\_IMPORT\_DESCRIPTOR\_vtkRenderingCore-8.90d

Do you know what I could be missing?

Thanks for the help.

---

<div class="post-metadata">

### Author: ![Kmilo9999](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/cc9497/32.png) [@Kmilo9999](https://discourse.vtk.org/u/Kmilo9999)
#### Post date: [April 23, 2019, 6:12pm UTC](https://discourse.vtk.org/t/visual-studio-vtk-8-9-lnk2019-vtkvolume-setproperty-unresolve-external-symbol/819/2 "2019-04-23T18:12:48Z")

</div>

I checked only the library folder path and not the include folder path. I was pointing to an unknown place.

You can close this thread.
