[vtkusers] lnk2019 errors

Joshua Pena joshua_pena at comcast.net
Thu Oct 25 04:34:03 EDT 2007


I am trying to get VTK to work with visual studio 2003 .net but i am 
getting some lnk2019 error trying to compile the following example program.

#include "vtkConeSource.h"
  #include "vtkPolyDataMapper.h"
  #include "vtkRenderWindow.h"
  #include "vtkCamera.h"
  #include "vtkActor.h"
  #include "vtkRenderer.h"

  int main() {
    vtkConeSource *cone = vtkConeSource::New();
    cone->SetHeight( 3.0 );
    cone->SetRadius( 1.0 );
    cone->SetResolution( 100 );

    vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
    coneMapper->SetInputConnection( cone->GetOutputPort() );

    vtkActor *coneActor = vtkActor::New();
    coneActor->SetMapper( coneMapper );

    vtkRenderer *ren1= vtkRenderer::New();
    ren1->AddActor( coneActor );
    ren1->SetBackground( 0.1, 0.2, 0.4 );

    vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer( ren1 );
    renWin->SetSize( 300, 300 );

    int i;
    for (i = 0; i < 360; ++i) {
      renWin->Render();
      ren1->GetActiveCamera()->Azimuth( 1 );
    }

    cone->Delete();
    coneMapper->Delete();
    coneActor->Delete();
    ren1->Delete();
    renWin->Delete();

    return 0;
  }

I get 9 different lnk2019 errors.

Here is an example of one of them?

test1 error LNK2019: unresolved external symbol "__declspec(dllimport) 
public: void __thiscall vtkCamera::Azimuth(double)" 
(__imp_?Azimuth at vtkCamera@@QAEXN at Z) referenced in function _main

Would appreciate any help, i have been extremely frustrated trying to 
get VTK to work right for me.




More information about the vtkusers mailing list