[vtkusers] Possible missing .lib ?

Jérôme jerome.velut at gmail.com
Thu May 12 01:53:52 EDT 2011


Hi,

When you need to know which libs to include because of an "unresolved"
error, here is a trick:
- read in the error message the class that is causing this. In your case, it
is vtkAlgorithm, through the lack of GetOutputPort.
- find the class header in the source tree, or thanks to the online doxygen
doc (here, vtkAlgorithm.h)
- the class declaration includes an VTK_XXX_EXPORT macro (needed for M$ dll)
: the XXX gives you the lib to link to. In your case, VTK_FILTERING_EXPORT
-> link to vtkFiltering.

It is important to read the error message, because the SetInputConnection
statement is not guilty : GetOutputPort is. You could search the wrong place
(though it's not the case here, as SetInputConnection and GetOutputPort are
both declared in vtkAlgorithm)

HTH
Jerome

2011/5/12 Bob Palank <bob at stlcc.org>

> I am learning and  building incrementally using the Cone example  -
> statement by statement
>
>   and adding .libs as required.
>
>
>
> I see :
>
>
> -------------------------------------------------------------------------------------
>
> vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();      // Needs no
> additional libs
>
>  //   coneMapper->SetInputConnection( cone->GetOutputPort() ); // when
> added it probably needs another lib ?
>
>
>
> with the above, I get
>
> ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
>
> ---------------------------------------------------------------------------------------
> when I uncomment  the coneMapper->SetInputConnection(
> cone->GetOutputPort() );  statement
> I get
>
> Cone01.obj : warning LNK4248: unresolved typeref token (01000016) for
> 'vtkAlgorithmOutput'; image may not run
>
> Cone01.obj : error LNK2028: unresolved token (0A00018A) "public: class
> vtkAlgorithmOutput * __thiscall vtkAlgorithm::GetOutputPort(void)"
> (?GetOutputPort at vtkAlgorithm@@$$FQAEPAVvtkAlgorithmOutput@@XZ) referenced
> in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
>
> Cone01.obj : error LNK2019: unresolved external symbol "public: class
> vtkAlgorithmOutput * __thiscall vtkAlgorithm::GetOutputPort(void)"
> (?GetOutputPort at vtkAlgorithm@@$$FQAEPAVvtkAlgorithmOutput@@XZ) referenced
> in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
>
> D:\Vtk561-bin\Examples\BobsExamples\Cone01\Debug\Cone01.exe : fatal error
> LNK1120: 2 unresolved externals
>
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========
>
>
>
> I suspect the libs I have lack required code and I need to include an
> additional dependency (library file).
>
> What documentation shows which .lib I need to support the coneMapper->SetInputConnection()
> statement ?
>
>
>
> As always, TIA.
>
>   Bob
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110512/217b26ce/attachment.htm>


More information about the vtkusers mailing list