[vtkusers] Unable to run a sample program

Prajwal Sapare prajwal.sapare at gmail.com
Wed Jul 27 09:52:25 EDT 2016


I just try to build a sample program, but I am getting an error stating
this...


1>------ Build started: Project: ConsoleApplication1, Configuration: Debug
Win32 ------
1>  stdafx.cpp
1>  ConsoleApplication1.cpp
1>ConsoleApplication1.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: class vtkAlgorithmOutput * __thiscall
vtkAlgorithm::GetOutputPort(void)" (__imp_?GetOutputPort at vtkAlgorithm
@@QAEPAVvtkAlgorithmOutput@@XZ) referenced in function _main
1>D:\syncplicity\z003npra\Documents\Visual Studio
2013\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal
error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



My code is: (A code from internet)

*******************************************************************************************************

#include "stdafx.h"
#include <windows.h>


#include <vtkSmartPointer.h>

#include <vtkActor.h>
#include <vtkCubeSource.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>

int main(int, char *[])
{
// Create a cube.
vtkSmartPointer<vtkCubeSource> cubeSource =
vtkSmartPointer<vtkCubeSource>::New();

// Create a mapper and actor.
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(cubeSource->GetOutputPort());

vtkSmartPointer<vtkActor> actor =
vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);

// Create a renderer, render window, and interactor
vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);

// Add the actors to the scene
renderer->AddActor(actor);
renderer->SetBackground(.3, .2, .1);

// Render and interact
renderWindow->Render();
renderWindowInteractor->Start();

return EXIT_SUCCESS;
}


******************************************************************************************************

Please let me know regarding this.


Regards,
Prajwal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160727/5e844417/attachment.html>


More information about the vtkusers mailing list