[vtkusers] Problems when compiling simple program in Qt Creator

Kenneth D'Aquila kfd182 at gmail.com
Thu Aug 8 01:14:25 EDT 2013


Hi All,

I am completely new to VTK and have not been able to successfully compile
one simple program.

#include "vtkConeSource.h"


int main()

{

        //Create a cone source object


    vtkConeSource *cone = vtkConeSource::New();

    cone->SetHeight(3.0);

    cone->SetRadius(1.0);

    cone->SetResolution(10);


	return 0;

}



When I try to compile, there are 32 undefined references. For example,

c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x1c):
undefined reference to `vtkInformationVector::GetInformationObject(int)'


I have read other posts similar to this problem, but I can't figure out
what is wrong with my .pro file for QtCreator.

from my .pro file:

INCLUDEPATH += c:/VTK/Source-VTK5.10.1/Common

INCLUDEPATH += c:/VTK/Source-VTK5.10.1/Graphics

INCLUDEPATH += c:/VTK/Source-VTK5.10.1/Filtering

INCLUDEPATH += c:/VTK/Source-VTK5.10.1/Rendering

INCLUDEPATH += c:/VTK/Source-VTK5.10.1/Hybrid

INCLUDEPATH += c:/VTK/Source-VTK5.10.1/Imaging

INCLUDEPATH += c:/VTK/Install-VTK5.10.1/includes/vtk-5.10


LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkCommon.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtksys.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libQVTK.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkViews.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkWidgets.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkInfovis.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkRendering.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkImaging.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkIO.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkFiltering.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkDICOMParser.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkpng.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtktiff.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkzlib.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkjpeg.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkalglib.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkexpat.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkverdict.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkmetaio.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkNetCDF.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtksqlite.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkexoIIc.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkftgl.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkfreetype.a

LIBS += c:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkHybrid.a


I have the source code in:

C:\VTK\Source-VTK5.10.1

I have the build code from after mingw32-make in:

C:\VTK\Build-VTK5.10.1

I have the installed code from after mingw32-make install in:

C:\VTK\Install-VTK5.10.1


I am on Windows and using the following software versions:

VTK 5.10.1
QtCreator 2.8.0
Qt 4.8.5
minGW 4.7.2, 32 bit,

VTK and Qt were compiled from source with minGW.

Any help would be appreciated. Thanks,

Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130808/17b0d727/attachment.htm>
-------------- next part --------------
23:22:57: Running steps for project Test...
23:22:57: Configuration unchanged, skipping qmake step.
23:22:57: Starting: "C:\qt-4.8.5\mingw32-4.7.2\bin\mingw32-make.exe" 
C:/qt-4.8.5/mingw32-4.7.2/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/kdaquila/Desktop/build-Test-Ken_MinGW-Release'
g++ -Wl,-s -Wl,-subsystem,console -mthreads -o release\Test.exe release/vtk_minimal.o  -L"c:\qt-4.8.5\qt-4.8.5-mingw-4.7.2-build\lib" C:/OpenCV/Builds/install/lib/*.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkCommon.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtksys.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libQVTK.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkViews.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkWidgets.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkInfovis.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkRendering.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkImaging.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkIO.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkFiltering.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkDICOMParser.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkpng.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtktiff.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkzlib.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkjpeg.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkalglib.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkexpat.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkverdict.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkmetaio.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkNetCDF.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtksqlite.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkexoIIc.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkftgl.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkfreetype.a C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkHybrid.a -lQtGui4 -lQtCore4 
Makefile.Release:74: recipe for target 'release\Test.exe' failed
mingw32-make[1]: Leaving directory 'C:/Users/kdaquila/Desktop/build-Test-Ken_MinGW-Release'
Makefile:34: recipe for target 'release' failed
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x1c): undefined reference to `vtkInformationVector::GetInformationObject(int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x36): undefined reference to `vtkInformation::Set(vtkInformationIntegerKey*, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x9f): undefined reference to `operator<<(std::ostream&, vtkIndent const&)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xf3): undefined reference to `operator<<(std::ostream&, vtkIndent const&)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x149): undefined reference to `operator<<(std::ostream&, vtkIndent const&)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x1ab): undefined reference to `operator<<(std::ostream&, vtkIndent const&)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x212): undefined reference to `operator<<(std::ostream&, vtkIndent const&)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x2d4): more undefined references to `operator<<(std::ostream&, vtkIndent const&)' follow
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x3a7): undefined reference to `vtkInformationVector::GetInformationObject(int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x3b9): undefined reference to `vtkInformation::Get(vtkInformationDataObjectKey*)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x4c6): undefined reference to `vtkPoints::New()'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x5ec): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x669): undefined reference to `vtkTransform::New()'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x687): undefined reference to `vtkTransformConcatenation::Translate(double, double, double)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x714): undefined reference to `vtkTransformConcatenation::Rotate(double, double, double, double)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x73b): undefined reference to `vtkAbstractTransform::Update()'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x921): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0x9f8): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xa70): undefined reference to `vtkTransformConcatenation::Rotate(double, double, double, double)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xaa6): undefined reference to `vtkTransformConcatenation::Rotate(double, double, double, double)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xb5a): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xbe3): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xd4c): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xdce): undefined reference to `vtkDataArrayTemplate<int>::WritePointer(int, int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xdf9): undefined reference to `vtkObjectFactory::CreateInstance(char const*)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xe14): undefined reference to `vtkObject::operator new(unsigned int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xece): undefined reference to `vtkObject::operator delete(void*)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xef5): undefined reference to `vtkObjectFactory::CreateInstance(char const*)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xf10): undefined reference to `vtkObject::operator new(unsigned int)'
C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj):vtkConeSource.cxx:(.text+0xfca): undefined reference to `vtkObject::operator delete(void*)'
c:/qt-4.8.5/mingw32-4.7.2/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: C:/VTK/Install-VTK5.10.1/lib/vtk_5.10/libvtkGraphics.a(vtkConeSource.cxx.obj): bad reloc address 0x1 in section `.text$_ZNK13vtkConeSource20GetClassNameInternalEv[__ZNK13vtkConeSource20GetClassNameInternalEv]'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [release\Test.exe] Error 1
mingw32-make: *** [release] Error 2
23:22:58: The process "C:\qt-4.8.5\mingw32-4.7.2\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Test (kit: Ken_MinGW)
When executing step 'Make'
23:22:58: Elapsed time: 00:01.


More information about the vtkusers mailing list