[vtkusers] Unable to run a sample program

Prajwal Sapare prajwal.sapare at gmail.com
Wed Jul 27 11:09:36 EDT 2016


Yes I know it's a linker error.
I followed all the steps given.

Step1: Linking of INCLUDE files in VS2013 of CMAKE_INSTALL Prefix path
Step2: Linking of LIB files in VS2013 of CMAKE_INSTALL Prefix path
Step3: Adding of  of LIB files name used in program to additional
dependencies in Linker C++.
Step4: Adding Bin folder path to system variables.

Anything apart from this? Do you know any link or tutorial that defines the
procedure properly?

Regards,
Prajwal

On Wed, Jul 27, 2016 at 4:58 PM, Cory Quammen <cory.quammen at kitware.com>
wrote:

> The error is a linker error that indicates you are not linking against
> the VTK libraries.
>
> HTH,
> Cory
>
> On Wed, Jul 27, 2016 at 9:52 AM, Prajwal Sapare
> <prajwal.sapare at gmail.com> wrote:
> >
> > 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
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Search the list archives at: http://markmail.org/search/?q=vtkusers
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
> >
>
>
>
> --
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160727/d5f5a0fe/attachment.html>


More information about the vtkusers mailing list