[vtkusers] compiling issues

Oliver Kania ptw.freiburg at googlemail.com
Tue Mar 17 03:42:04 EDT 2009


Hello,
If you use the static libraries, only what is really needed will be linked
in.
Simple point the liker to the directory contiaining all vtk libs and add all
libs
as link objects using cut+paste from some VTK example. I dont think there is
a more convenient method.

regards,
Oliver

2009/3/16 Yifei Li <yifli at mtu.edu>

> I fixed the problem. I missed some libraries:
> vtkIO.lib
> vtkjpeg.lib
> vtkpng.lib
> vtktiff.lib
> vtkzlib.lib
> vtkexpat.lib
>
> 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.
>
> Is there anyone who can give me some suggestions on how to figure what
> libraries I need for a vtk project?
>
> Thanks
>
> Yifei
>
> Yifei Li wrote:
>
>> Hi all,
>>
>> My OS is WinXP and IDE is Visual Studio 2008 C++ Express.
>>
>> 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
>> I also added vtkCommon.lib, vtkGraphics.lib, vtkRendering.lib, vtksys.lib,
>> vtkFiltering.lib and opengl32.lib to my project.
>>
>> 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
>>
>> Yifei
>>
>> 1>Linking...
>> 1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
>> libs; use /NODEFAULTLIB:library
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char
>> const *,int,double *)" (?GetVectorAttribute at vtkXMLDataElement
>> @@QAEHPBDHPAN at Z) referenced in function "protected: void __thiscall
>> vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember at vtkProperty
>> @@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char
>> const *,int,double *)" (?GetVectorAttribute at vtkXMLDataElement
>> @@QAEHPBDHPAN at Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char
>> const *,int,float *)" (?GetVectorAttribute at vtkXMLDataElement
>> @@QAEHPBDHPAM at Z) referenced in function "protected: void __thiscall
>> vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember at vtkProperty
>> @@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char
>> const *,int,float *)" (?GetVectorAttribute at vtkXMLDataElement
>> @@QAEHPBDHPAM at Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char
>> const *,int,int *)" (?GetVectorAttribute at vtkXMLDataElement@@QAEHPBDHPAH at Z)
>> referenced in function "protected: void __thiscall
>> vtkProperty::LoadMember(class vtkXMLDataElement *)" (?LoadMember at vtkProperty
>> @@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetVectorAttribute(char
>> const *,int,int *)" (?GetVectorAttribute at vtkXMLDataElement@@QAEHPBDHPAH at Z
>> )
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: char const * __thiscall vtkXMLDataElement::GetAttribute(char
>> const *)" (?GetAttribute at vtkXMLDataElement@@QAEPBDPBD at Z) referenced in
>> function "protected: void __thiscall vtkProperty::LoadMember(class
>> vtkXMLDataElement *)" (?LoadMember at vtkProperty@@IAEXPAVvtkXMLDataElement@
>> @@Z)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external
>> symbol "public: char const * __thiscall vtkXMLDataElement::GetAttribute(char
>> const *)" (?GetAttribute at vtkXMLDataElement@@QAEPBDPBD at Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: class vtkXMLDataElement * __thiscall
>> vtkXMLDataElement::GetNestedElement(int)"
>> (?GetNestedElement at vtkXMLDataElement@@QAEPAV1 at H@Z) referenced in function
>> "protected: void __thiscall vtkProperty::LoadProperty(void)"
>> (?LoadProperty at vtkProperty@@IAEXXZ)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external
>> symbol "public: class vtkXMLDataElement * __thiscall
>> vtkXMLDataElement::GetNestedElement(int)"
>> (?GetNestedElement at vtkXMLDataElement@@QAEPAV1 at H@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall
>> vtkXMLDataElement::GetNumberOfNestedElements(void)"
>> (?GetNumberOfNestedElements at vtkXMLDataElement@@QAEHXZ) referenced in
>> function "protected: void __thiscall vtkProperty::LoadProperty(void)"
>> (?LoadProperty at vtkProperty@@IAEXXZ)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2001: unresolved external
>> symbol "public: int __thiscall
>> vtkXMLDataElement::GetNumberOfNestedElements(void)"
>> (?GetNumberOfNestedElements at vtkXMLDataElement@@QAEHXZ)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: class vtkXMLDataElement * __thiscall
>> vtkXMLMaterial::GetProperty(int)" (?GetProperty at vtkXMLMaterial
>> @@QAEPAVvtkXMLDataElement@@H at Z) referenced in function "protected: void
>> __thiscall vtkProperty::LoadProperty(void)" (?LoadProperty at vtkProperty
>> @@IAEXXZ)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static char * __cdecl vtkXMLShader::LocateFile(char const
>> *)" (?LocateFile at vtkXMLShader@@SAPADPBD at Z) referenced in function
>> "protected: void __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement
>> *)" (?LoadTexture at vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkJPEGReader * __cdecl
>> vtkJPEGReader::New(void)" (?New at vtkJPEGReader@@SAPAV1 at XZ) referenced in
>> function "protected: void __thiscall vtkProperty::LoadTexture(class
>> vtkXMLDataElement *)" (?LoadTexture at vtkProperty
>> @@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkTIFFReader * __cdecl
>> vtkTIFFReader::New(void)" (?New at vtkTIFFReader@@SAPAV1 at XZ) referenced in
>> function "protected: void __thiscall vtkProperty::LoadTexture(class
>> vtkXMLDataElement *)" (?LoadTexture at vtkProperty
>> @@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkPNMReader * __cdecl vtkPNMReader::New(void)"
>> (?New at vtkPNMReader@@SAPAV1 at XZ) referenced in function "protected: void
>> __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)"
>> (?LoadTexture at vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkPNGReader * __cdecl vtkPNGReader::New(void)"
>> (?New at vtkPNGReader@@SAPAV1 at XZ) referenced in function "protected: void
>> __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)"
>> (?LoadTexture at vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkBMPReader * __cdecl vtkBMPReader::New(void)"
>> (?New at vtkBMPReader@@SAPAV1 at XZ) referenced in function "protected: void
>> __thiscall vtkProperty::LoadTexture(class vtkXMLDataElement *)"
>> (?LoadTexture at vtkProperty@@IAEXPAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: class vtkXMLDataElement * __thiscall
>> vtkXMLMaterial::GetTexture(int)" (?GetTexture at vtkXMLMaterial
>> @@QAEPAVvtkXMLDataElement@@H at Z) referenced in function "protected: void
>> __thiscall vtkProperty::LoadTextures(void)" (?LoadTextures at vtkProperty
>> @@IAEXXZ)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLMaterial::GetNumberOfTextures(void)"
>> (?GetNumberOfTextures at vtkXMLMaterial@@QAEHXZ) referenced in function
>> "protected: void __thiscall vtkProperty::LoadTextures(void)"
>> (?LoadTextures at vtkProperty@@IAEXXZ)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall
>> vtkXMLMaterial::GetNumberOfFragmentShaders(void)"
>> (?GetNumberOfFragmentShaders at vtkXMLMaterial@@QAEHXZ) referenced in
>> function "public: void __thiscall vtkProperty::LoadMaterial(class
>> vtkXMLMaterial *)" (?LoadMaterial at vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)
>> 1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2001: unresolved
>> external symbol "public: int __thiscall
>> vtkXMLMaterial::GetNumberOfFragmentShaders(void)"
>> (?GetNumberOfFragmentShaders at vtkXMLMaterial@@QAEHXZ)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall
>> vtkXMLMaterial::GetNumberOfVertexShaders(void)"
>> (?GetNumberOfVertexShaders at vtkXMLMaterial@@QAEHXZ) referenced in function
>> "public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)"
>> (?LoadMaterial at vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)
>> 1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2001: unresolved
>> external symbol "public: int __thiscall
>> vtkXMLMaterial::GetNumberOfVertexShaders(void)"
>> (?GetNumberOfVertexShaders at vtkXMLMaterial@@QAEHXZ)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLMaterial::GetShaderLanguage(void)"
>> (?GetShaderLanguage at vtkXMLMaterial@@QAEHXZ) referenced in function
>> "public: void __thiscall vtkProperty::LoadMaterial(class vtkXMLMaterial *)"
>> (?LoadMaterial at vtkProperty@@QAEXPAVvtkXMLMaterial@@@Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkXMLMaterial * __cdecl
>> vtkXMLMaterial::CreateInstance(char const *)"
>> (?CreateInstance at vtkXMLMaterial@@SAPAV1 at PBD@Z) referenced in function
>> "public: void __thiscall vtkProperty::LoadMaterial(char const *)"
>> (?LoadMaterial at vtkProperty@@QAEXPBD at Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: void __thiscall vtkXMLMaterialParser::SetMaterial(class
>> vtkXMLMaterial *)" (?SetMaterial at vtkXMLMaterialParser
>> @@QAEXPAVvtkXMLMaterial@@@Z) referenced in function "public: void
>> __thiscall vtkProperty::LoadMaterialFromString(char const *)"
>> (?LoadMaterialFromString at vtkProperty@@QAEXPBD at Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkXMLMaterial * __cdecl
>> vtkXMLMaterial::New(void)" (?New at vtkXMLMaterial@@SAPAV1 at XZ) referenced in
>> function "public: void __thiscall vtkProperty::LoadMaterialFromString(char
>> const *)" (?LoadMaterialFromString at vtkProperty@@QAEXPBD at Z)
>> 1>vtkRendering.lib(vtkProperty.obj) : error LNK2019: unresolved external
>> symbol "public: static class vtkXMLMaterialParser * __cdecl
>> vtkXMLMaterialParser::New(void)" (?New at vtkXMLMaterialParser@@SAPAV1 at XZ)
>> referenced in function "public: void __thiscall
>> vtkProperty::LoadMaterialFromString(char const *)"
>> (?LoadMaterialFromString at vtkProperty@@QAEXPBD at Z)
>> 1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2019: unresolved
>> external symbol "public: class vtkXMLShader * __thiscall
>> vtkXMLMaterial::GetFragmentShader(int)" (?GetFragmentShader at vtkXMLMaterial
>> @@QAEPAVvtkXMLShader@@H at Z) referenced in function "public: virtual void
>> __thiscall vtkShaderProgram::ReadMaterial(void)"
>> (?ReadMaterial at vtkShaderProgram@@UAEXXZ)
>> 1>vtkRendering.lib(vtkShaderProgram.obj) : error LNK2019: unresolved
>> external symbol "public: class vtkXMLShader * __thiscall
>> vtkXMLMaterial::GetVertexShader(int)" (?GetVertexShader at vtkXMLMaterial
>> @@QAEPAVvtkXMLShader@@H at Z) referenced in function "public: virtual void
>> __thiscall vtkShaderProgram::ReadMaterial(void)"
>> (?ReadMaterial at vtkShaderProgram@@UAEXXZ)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLDataElement::GetScalarAttribute(char
>> const *,int &)" (?GetScalarAttribute at vtkXMLDataElement@@QAEHPBDAAH at Z)
>> referenced in function "protected: void __thiscall
>> vtkShader::SetLightParameter(class vtkActor *,class vtkRenderer *,class
>> vtkXMLDataElement *)" (?SetLightParameter at vtkShader@@IAEXPAVvtkActor@
>> @PAVvtkRenderer@@PAVvtkXMLDataElement@@@Z)
>> 1>vtkRendering.lib(vtkShader.obj) : error LNK2019: unresolved external
>> symbol "public: int __thiscall vtkXMLShader::GetScope(void)"
>> (?GetScope at vtkXMLShader@@QAEHXZ) referenced in function "public: int
>> __thiscall vtkShader::GetScope(void)" (?GetScope at vtkShader@@QAEHXZ)
>> 1>vtkRendering.lib(vtkGLSLShader.obj) : error LNK2001: unresolved external
>> symbol "public: int __thiscall vtkXMLShader::GetScope(void)"
>> (?GetScope at vtkXMLShader@@QAEHXZ)
>> 1>vtkRendering.lib(vtkGLSLShader.obj) : error LNK2019: unresolved external
>> symbol "public: char const * __thiscall vtkXMLShader::GetName(void)"
>> (?GetName at vtkXMLShader@@QAEPBDXZ) referenced in function "public: virtual
>> int __thiscall vtkGLSLShader::Compile(void)" (?Compile at vtkGLSLShader
>> @@UAEHXZ)
>> 1>vtkRendering.lib(vtkGLSLShader.obj) : error LNK2019: unresolved external
>> symbol "public: char const * __thiscall vtkXMLShader::GetCode(void)"
>> (?GetCode at vtkXMLShader@@QAEPBDXZ) referenced in function "public: virtual
>> int __thiscall vtkGLSLShader::Compile(void)" (?Compile at vtkGLSLShader
>> @@UAEHXZ)
>> 1>C:\Documents and Settings\yifli\My Documents\Visual Studio
>> 2008\Projects\vtk\Debug\vtk.exe : fatal error LNK1120: 28 unresolved
>> externals
>> 1>Build log was saved at "file://c:\Documents and Settings\yifli\My
>> Documents\Visual Studio 2008\Projects\vtk\vtk\Debug\BuildLog.htm"
>> 1>vtk - 38 error(s), 1 warning(s)
>> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
>> ==========
>>
>> _______________________________________________
>> 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
>>
>
> _______________________________________________
> 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/20090317/9a700c1b/attachment.htm>


More information about the vtkusers mailing list