[vtkusers] Help! CMake & VTK42 -- about installing and compiling

Bruno Travençolo bant at grad.icmc.usp.br
Wed Mar 26 20:54:06 EST 2003


Hello Phoebe and vtkusers,

>  
> I set the source directory and the build directory the same directory, 
> for example C:\mytest, I also tried set the build dirtory 
> C:\mytest\build, but the same problem arised.  Oh, my god, I really 
> don't what's wrong!

mee too.....

>  
> 2, If  I couldn't pass the above step, then  I can't run vkt examples 
> in VC++? I tried, and there are always compiling problems:
> -----------
> T1.obj : error LNK2001: unresolved external symbol 
> "__declspec(dllimport) public: void __thiscall 
> vtkPolyDataMapper::SetInput(class vtkPolyData *)" 
> (__imp_?SetInput at vtkPolyDataMapper@@QAEXPAVvtkPolyData@@@Z 
> <mailto:__imp_?SetInput at vtkPolyDataMapper@@QAEXPAVvtkPolyData@@@Z>)
> T1.obj : error LNK2001: unresolved external symbol 
> "__declspec(dllimport) public: class vtkPolyData * __thiscall 
> vtkPolyDataSource::GetOutput(void)" 
> (__imp_?GetOutput at vtkPolyDataSource@@QAEPAVvtkPolyData@@XZ 
> <mailto:__imp_?GetOutput at vtkPolyDataSource@@QAEPAVvtkPolyData@@XZ>)
> T1.obj : error LNK2001: unresolved external symbol 
> "__declspec(dllimport) public: static class vtkPolyDataMapper * 
> __cdecl vtkPolyDataMapper::New(void)" 
> (__imp_?New at vtkPolyDataMapper@@SAPAV1 at XZ 
> <mailto:__imp_?New at vtkPolyDataMapper@@SAPAV1 at XZ>)
> T1.obj : error LNK2001: unresolved external symbol 
> "__declspec(dllimport) public: static class vtkCubeSource * __cdecl 
> vtkCubeSource::New(void)" (__imp_?New at vtkCubeSource@@SAPAV1 at XZ 
> <mailto:__imp_?New at vtkCubeSource@@SAPAV1 at XZ>)

I had a similar problem. When I create my project I had forgotten to 
include some libraries to it. So, check out if you had included all the 
libraries. In Visual C++ 7.0, go to the "Project Properties / 
Configuration Properties / Linker / Input / Additional Dependencies" and 
include this libraries:
vtkCommon.lib
vtkFiltering.lib
vtkGraphics.lib
vtkHybrid.lib
vtkImaging.lib
vtkIO.lib
vtkjpeg.lib
vtkParallel.lib
vtkpng.lib
vtkRendering.lib
vtkPatented.lib <-- add this one only if you had compiled it!
vtkzlib.lib

And don't forget to set the approprieted directory in:
"Project Properties / Configuration Properties / Linker /  General / 
Additional Library Directories "
to something like "c:\Program Files\vtk42\lib\vtk"

I hope this can help you!

[]'s

Bruno.




More information about the vtkusers mailing list