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"><<a href="mailto:yifli@mtu.edu">yifli@mtu.edu</a>></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'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 -> 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>Linking...<br>
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,double *)" (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAN@Z) referenced in function "protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,double *)" (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAN@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,float *)" (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAM@Z) referenced in function "protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,float *)" (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAM@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,int *)" (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAH@Z) referenced in function "protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char const *,int,int *)" (?GetVectorAttribute@vtkXMLDataElement@@QAEHPBDHPAH@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: char const * __thiscall vtkXMLDataElement::GetAttribute(char const *)" (?GetAttribute@vtkXMLDataElement@@QAEPBDPBD@Z) referenced in function "protected: void __thiscall vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol "public: char const * __thiscall vtkXMLDataElement::GetAttribute(char const *)" (?GetAttribute@vtkXMLDataElement@@QAEPBDPBD@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: class vtkXMLDataElement * __thiscall vtkXMLDataElement::GetNestedElement(int)" (?GetNestedElement@vtkXMLDataElement@@QAEPAV1@H@Z) referenced in function "protected: void __thiscall vtkProperty::LoadProperty(void)" (?LoadProperty@vtkProperty@@IAEXXZ)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol "public: class vtkXMLDataElement * __thiscall vtkXMLDataElement::GetNestedElement(int)" (?GetNestedElement@vtkXMLDataElement@@QAEPAV1@H@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetNumberOfNestedElements(void)" (?GetNumberOfNestedElements@vtkXMLDataElement@@QAEHXZ) referenced in function "protected: void __thiscall vtkProperty::LoadProperty(void)" (?LoadProperty@vtkProperty@@IAEXXZ)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetNumberOfNestedElements(void)" (?GetNumberOfNestedElements@vtkXMLDataElement@@QAEHXZ)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: class vtkXMLDataElement * __thiscall vtkXMLMaterial::GetProperty(int)" (?GetProperty@vtkXMLMaterial@@QAEPAVvtkXMLDataElement@@H@Z) referenced in function "protected: void __thiscall vtkProperty::LoadProperty(void)" (?LoadProperty@vtkProperty@@IAEXXZ)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static char * __cdecl vtkXMLShader::LocateFile(char const *)" (?LocateFile@vtkXMLShader@@SAPADPBD@Z) referenced in function "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)" (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkJPEGReader * __cdecl vtkJPEGReader::New(void)" (?New@vtkJPEGReader@@SAPAV1@XZ) referenced in function "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)" (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkTIFFReader * __cdecl vtkTIFFReader::New(void)" (?New@vtkTIFFReader@@SAPAV1@XZ) referenced in function "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)" (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkPNMReader * __cdecl vtkPNMReader::New(void)" (?New@vtkPNMReader@@SAPAV1@XZ) referenced in function "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)" (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkPNGReader * __cdecl vtkPNGReader::New(void)" (?New@vtkPNGReader@@SAPAV1@XZ) referenced in function "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)" (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkBMPReader * __cdecl vtkBMPReader::New(void)" (?New@vtkBMPReader@@SAPAV1@XZ) referenced in function "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)" (?LoadTexture@vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: class vtkXMLDataElement * __thiscall vtkXMLMaterial::GetTexture(int)" (?GetTexture@vtkXMLMaterial@@QAEPAVvtkXMLDataElement@@H@Z) referenced in function "protected: void __thiscall vtkProperty::LoadTextures(void)" (?LoadTextures@vtkProperty@@IAEXXZ)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLMaterial::GetNumberOfTextures(void)" (?GetNumberOfTextures@vtkXMLMaterial@@QAEHXZ) referenced in function "protected: void __thiscall vtkProperty::LoadTextures(void)" (?LoadTextures@vtkProperty@@IAEXXZ)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLMaterial::GetNumberOfFragmentShaders(void)" (?GetNumberOfFragmentShaders@vtkXMLMaterial@@QAEHXZ) referenced in function "public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)" (?LoadMaterial@vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)<br>
1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLMaterial::GetNumberOfFragmentShaders(void)" (?GetNumberOfFragmentShaders@vtkXMLMaterial@@QAEHXZ)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLMaterial::GetNumberOfVertexShaders(void)" (?GetNumberOfVertexShaders@vtkXMLMaterial@@QAEHXZ) referenced in function "public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)" (?LoadMaterial@vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)<br>
1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLMaterial::GetNumberOfVertexShaders(void)" (?GetNumberOfVertexShaders@vtkXMLMaterial@@QAEHXZ)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLMaterial::GetShaderLanguage(void)" (?GetShaderLanguage@vtkXMLMaterial@@QAEHXZ) referenced in function "public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)" (?LoadMaterial@vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkXMLMaterial * __cdecl vtkXMLMaterial::CreateInstance(char const *)" (?CreateInstance@vtkXMLMaterial@@SAPAV1@PBD@Z) referenced in function "public: void __thiscall vtkProperty::LoadMaterial(char const *)" (?LoadMaterial@vtkProperty@@QAEXPBD@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: void __thiscall vtkXMLMaterialParser::SetMaterial(class vtkXMLMaterial *)" (?SetMaterial@vtkXMLMaterialParser@@QAEXPAVvtkXMLMaterial@@@Z) referenced in function "public: void __thiscall vtkProperty::LoadMaterialFromString(char const *)" (?LoadMaterialFromString@vtkProperty@@QAEXPBD@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkXMLMaterial * __cdecl vtkXMLMaterial::New(void)" (?New@vtkXMLMaterial@@SAPAV1@XZ) referenced in function "public: void __thiscall vtkProperty::LoadMaterialFromString(char const *)" (?LoadMaterialFromString@vtkProperty@@QAEXPBD@Z)<br>
1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external symbol "public: static class vtkXMLMaterialParser * __cdecl vtkXMLMaterialParser::New(void)" (?New@vtkXMLMaterialParser@@SAPAV1@XZ) referenced in function "public: void __thiscall vtkProperty::LoadMaterialFromString(char const *)" (?LoadMaterialFromString@vtkProperty@@QAEXPBD@Z)<br>
1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2019: unresolved external symbol "public: class vtkXMLShader * __thiscall vtkXMLMaterial::GetFragmentShader(int)" (?GetFragmentShader@vtkXMLMaterial@@QAEPAVvtkXMLShader@@H@Z) referenced in function "public: virtual void __thiscall vtkShaderProgram::ReadMaterial(void)" (?ReadMaterial@vtkShaderProgram@@UAEXXZ)<br>
1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2019: unresolved external symbol "public: class vtkXMLShader * __thiscall vtkXMLMaterial::GetVertexShader(int)" (?GetVertexShader@vtkXMLMaterial@@QAEPAVvtkXMLShader@@H@Z) referenced in function "public: virtual void __thiscall vtkShaderProgram::ReadMaterial(void)" (?ReadMaterial@vtkShaderProgram@@UAEXXZ)<br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLDataElement::GetScalarAttribute(char const *,int &)" (?GetScalarAttribute@vtkXMLDataElement@@QAEHPBDAAH@Z) referenced in function "protected: void __thiscall vtkShader::SetLightParameter(class vtkActor *,class vtkRenderer *,class vtkXMLDataElement *)" (?SetLightParameter@vtkShader@@IAEXPAVvtkActor@@PAVvtkRenderer@@PAVvtkXMLDataElement@@@Z) <br>
1>vtkRendering.lib(vtkShader.obj) : error LNK2019: unresolved external symbol "public: int __thiscall vtkXMLShader::GetScope(void)" (?GetScope@vtkXMLShader@@QAEHXZ) referenced in function "public: int __thiscall vtkShader::GetScope(void)" (?GetScope@vtkShader@@QAEHXZ)<br>
1>vtkRendering.lib(vtkGLSLShader.obj) : error LNK2001: unresolved external symbol "public: int __thiscall vtkXMLShader::GetScope(void)" (?GetScope@vtkXMLShader@@QAEHXZ)<br>
1>vtkRendering.lib(vtkGLSLShader.obj) : error LNK2019: unresolved external symbol "public: char const * __thiscall vtkXMLShader::GetName(void)" (?GetName@vtkXMLShader@@QAEPBDXZ) referenced in function "public: virtual int __thiscall vtkGLSLShader::Compile(void)" (?Compile@vtkGLSLShader@@UAEHXZ)<br>
1>vtkRendering.lib(vtkGLSLShader.obj) : error LNK2019: unresolved external symbol "public: char const * __thiscall vtkXMLShader::GetCode(void)" (?GetCode@vtkXMLShader@@QAEPBDXZ) referenced in function "public: virtual int __thiscall vtkGLSLShader::Compile(void)" (?Compile@vtkGLSLShader@@UAEHXZ)<br>
1>C:\Documents and Settings\yifli\My Documents\Visual Studio 2008\Projects\vtk\Debug\vtk.exe : fatal error LNK1120: 28 unresolved externals<br>
1>Build log was saved at "file://c:\Documents and Settings\yifli\My Documents\Visual Studio 2008\Projects\vtk\vtk\Debug\BuildLog.htm"<br>
1>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>