Hello, <br>If you use the static libraries, only what is really needed will be linked in.<br>Simple point the liker to the directory contiaining all vtk libs and add all libs<br>as link objects using cut+paste from some VTK example. I dont think there is a more convenient method.<br>
<br>regards,<br>Oliver<br><br><div class="gmail_quote">2009/3/16 Yifei Li <span dir="ltr">&lt;<a href="mailto:yifli@mtu.edu">yifli@mtu.edu</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I fixed the problem. I missed some libraries:<br>
vtkIO.lib<br>
vtkjpeg.lib<br>
vtkpng.lib<br>
vtktiff.lib<br>
vtkzlib.lib<br>
vtkexpat.lib<br>
<br>
However, I still feel it&#39;s very tricky to include the necessary libraries for a VTK project. And even for a simple vtk program like mine, I have to include so many libraries.<br>
<br>
Is there anyone who can give me some suggestions on how to figure what libraries I need for a vtk project?<br>
<br>
Thanks<br><font color="#888888">
<br>
Yifei</font><div><div></div><div class="h5"><br>
Yifei Li wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
My OS is WinXP and IDE is Visual Studio 2008 C++ Express.<br>
<br>
I downloaded cmake 2.6 and VTK5.2.1, and then successfully built static libraries and header files. I added the corresponding directories for libraries and header files to  Projects and Solutions -&gt; VC++  Directories<br>

I also added vtkCommon.lib, vtkGraphics.lib, vtkRendering.lib, vtksys.lib, vtkFiltering.lib and opengl32.lib to my project.<br>
<br>
Then I tried to compile my project but had the following linking errors ( the code I am tring to compile is a vtk example). Could someone help me out?  Thanks<br>
<br>
Yifei<br>
<br>
1&gt;Linking...<br>
1&gt;LINK : warning LNK4098: defaultlib &#39;MSVCRT&#39; conflicts with use of other libs; use /NODEFAULTLIB:library<br>
1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,double *)&quot; (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAN@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)&quot; (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,double *)&quot; (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAN@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,float *)&quot; (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAM@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)&quot; (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,float *)&quot; (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAM@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,int *)&quot; (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAH@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)&quot; (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,int *)&quot; (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAH@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: char const * __thiscall vtkXMLDataElement::GetAttribute(char const *)&quot; (?GetAttribute@vtkXMLDataElement@@QAEPBDPBD@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)&quot; (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol &quot;public: char const * __thiscall vtkXMLDataElement::GetAttribute(char const *)&quot; (?GetAttribute@vtkXMLDataElement@@QAEPBDPBD@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: class vtkXMLDataElement * __thiscall vtkXMLDataElement::GetNestedElement(int)&quot; (?GetNestedElement@vtkXMLDataElement@@QAEPAV1@H@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadProperty(void)&quot; (?LoadProperty@vtkProperty@@IAEXXZ)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol &quot;public: class vtkXMLDataElement * __thiscall vtkXMLDataElement::GetNestedElement(int)&quot; (?GetNestedElement@vtkXMLDataElement@@QAEPAV1@H@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetNumberOfNestedElements(void)&quot; (?GetNumberOfNestedElements@vtkXMLDataElement@@QAEHXZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadProperty(void)&quot; (?LoadProperty@vtkProperty@@IAEXXZ)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetNumberOfNestedElements(void)&quot; (?GetNumberOfNestedElements@vtkXMLDataElement@@QAEHXZ)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: class vtkXMLDataElement * __thiscall vtkXMLMaterial::GetProperty(int)&quot; (?GetProperty@vtkXMLMaterial@@QAEPAVvtkXMLDataElement@@H@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadProperty(void)&quot; (?LoadProperty@vtkProperty@@IAEXXZ)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static char * __cdecl vtkXMLShader::LocateFile(char const *)&quot; (?LocateFile@vtkXMLShader@@SAPADPBD@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)&quot; (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkJPEGReader * __cdecl vtkJPEGReader::New(void)&quot; (?New@vtkJPEGReader@@SAPAV1@XZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)&quot; (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkTIFFReader * __cdecl vtkTIFFReader::New(void)&quot; (?New@vtkTIFFReader@@SAPAV1@XZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)&quot; (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkPNMReader * __cdecl vtkPNMReader::New(void)&quot; (?New@vtkPNMReader@@SAPAV1@XZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)&quot; (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkPNGReader * __cdecl vtkPNGReader::New(void)&quot; (?New@vtkPNGReader@@SAPAV1@XZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)&quot; (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkBMPReader * __cdecl vtkBMPReader::New(void)&quot; (?New@vtkBMPReader@@SAPAV1@XZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)&quot; (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: class vtkXMLDataElement * __thiscall vtkXMLMaterial::GetTexture(int)&quot; (?GetTexture@vtkXMLMaterial@@QAEPAVvtkXMLDataElement@@H@Z) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTextures(void)&quot; (?LoadTextures@vtkProperty@@IAEXXZ)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLMaterial::GetNumberOfTextures(void)&quot; (?GetNumberOfTextures@vtkXMLMaterial@@QAEHXZ) referenced in function &quot;protected: void __thiscall vtkProperty::LoadTextures(void)&quot; (?LoadTextures@vtkProperty@@IAEXXZ)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLMaterial::GetNumberOfFragmentShaders(void)&quot; (?GetNumberOfFragmentShaders@vtkXMLMaterial@@QAEHXZ) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)&quot; (?LoadMaterial@vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)<br>

1&gt;vtkRendering.lib(vtkShaderProgram.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLMaterial::GetNumberOfFragmentShaders(void)&quot; (?GetNumberOfFragmentShaders@vtkXMLMaterial@@QAEHXZ)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLMaterial::GetNumberOfVertexShaders(void)&quot; (?GetNumberOfVertexShaders@vtkXMLMaterial@@QAEHXZ) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)&quot; (?LoadMaterial@vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)<br>

1&gt;vtkRendering.lib(vtkShaderProgram.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLMaterial::GetNumberOfVertexShaders(void)&quot; (?GetNumberOfVertexShaders@vtkXMLMaterial@@QAEHXZ)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLMaterial::GetShaderLanguage(void)&quot; (?GetShaderLanguage@vtkXMLMaterial@@QAEHXZ) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)&quot; (?LoadMaterial@vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkXMLMaterial * __cdecl vtkXMLMaterial::CreateInstance(char const *)&quot; (?CreateInstance@vtkXMLMaterial@@SAPAV1@PBD@Z) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterial(char const *)&quot; (?LoadMaterial@vtkProperty@@QAEXPBD@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: void __thiscall vtkXMLMaterialParser::SetMaterial(class vtkXMLMaterial *)&quot; (?SetMaterial@vtkXMLMaterialParser@@QAEXPAVvtkXMLMaterial@@@Z) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterialFromString(char const *)&quot; (?LoadMaterialFromString@vtkProperty@@QAEXPBD@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkXMLMaterial * __cdecl vtkXMLMaterial::New(void)&quot; (?New@vtkXMLMaterial@@SAPAV1@XZ) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterialFromString(char const *)&quot; (?LoadMaterialFromString@vtkProperty@@QAEXPBD@Z)<br>

1&gt;vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol &quot;public: static class vtkXMLMaterialParser * __cdecl vtkXMLMaterialParser::New(void)&quot; (?New@vtkXMLMaterialParser@@SAPAV1@XZ) referenced in function &quot;public: void __thiscall vtkProperty::LoadMaterialFromString(char const *)&quot; (?LoadMaterialFromString@vtkProperty@@QAEXPBD@Z)<br>

1&gt;vtkRendering.lib(vtkShaderProgram.obj) : error LNK2019: unresolved external symbol &quot;public: class vtkXMLShader * __thiscall vtkXMLMaterial::GetFragmentShader(int)&quot; (?GetFragmentShader@vtkXMLMaterial@@QAEPAVvtkXMLShader@@H@Z) referenced in function &quot;public: virtual void __thiscall vtkShaderProgram::ReadMaterial(void)&quot; (?ReadMaterial@vtkShaderProgram@@UAEXXZ)<br>

1&gt;vtkRendering.lib(vtkShaderProgram.obj) : error LNK2019: unresolved external symbol &quot;public: class vtkXMLShader * __thiscall vtkXMLMaterial::GetVertexShader(int)&quot; (?GetVertexShader@vtkXMLMaterial@@QAEPAVvtkXMLShader@@H@Z) referenced in function &quot;public: virtual void __thiscall vtkShaderProgram::ReadMaterial(void)&quot; (?ReadMaterial@vtkShaderProgram@@UAEXXZ)<br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLDataElement::GetScalarAttribute(char const *,int &amp;)&quot; (?GetScalarAttribute@vtkXMLDataElement@@QAEHPBDAAH@Z) referenced in function &quot;protected: void __thiscall vtkShader::SetLightParameter(class vtkActor *,class vtkRenderer *,class vtkXMLDataElement *)&quot; (?SetLightParameter@vtkShader@@IAEXPAVvtkActor@@PAVvtkRenderer@@PAVvtkXMLDataElement@@@Z) <br>

1&gt;vtkRendering.lib(vtkShader.obj) : error LNK2019: unresolved external symbol &quot;public: int __thiscall vtkXMLShader::GetScope(void)&quot; (?GetScope@vtkXMLShader@@QAEHXZ) referenced in function &quot;public: int __thiscall vtkShader::GetScope(void)&quot; (?GetScope@vtkShader@@QAEHXZ)<br>

1&gt;vtkRendering.lib(vtkGLSLShader.obj) : error LNK2001: unresolved external symbol &quot;public: int __thiscall vtkXMLShader::GetScope(void)&quot; (?GetScope@vtkXMLShader@@QAEHXZ)<br>
1&gt;vtkRendering.lib(vtkGLSLShader.obj) : error LNK2019: unresolved external symbol &quot;public: char const * __thiscall vtkXMLShader::GetName(void)&quot; (?GetName@vtkXMLShader@@QAEPBDXZ) referenced in function &quot;public: virtual int __thiscall vtkGLSLShader::Compile(void)&quot; (?Compile@vtkGLSLShader@@UAEHXZ)<br>

1&gt;vtkRendering.lib(vtkGLSLShader.obj) : error LNK2019: unresolved external symbol &quot;public: char const * __thiscall vtkXMLShader::GetCode(void)&quot; (?GetCode@vtkXMLShader@@QAEPBDXZ) referenced in function &quot;public: virtual int __thiscall vtkGLSLShader::Compile(void)&quot; (?Compile@vtkGLSLShader@@UAEHXZ)<br>

1&gt;C:\Documents and Settings\yifli\My Documents\Visual Studio 2008\Projects\vtk\Debug\vtk.exe : fatal error LNK1120: 28 unresolved externals<br>
1&gt;Build log was saved at &quot;file://c:\Documents and Settings\yifli\My Documents\Visual Studio 2008\Projects\vtk\vtk\Debug\BuildLog.htm&quot;<br>
1&gt;vtk - 38 error(s), 1 warning(s)<br>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>