[vtkusers] undefined reference problem while linking
Shailender Kanwar
shailender.kanwar at gmail.com
Mon Dec 1 00:35:16 EST 2008
hi all
i am a newbie to vtk. I am using vtk 5.2.
while compiling a QT application using vtk, i keep on getting
undefined reference error for vtk classes and methods
in my program iam trying only to create a QVTKWidget object
but i am facing a load of undefined references
i have recompiled vtk many times tweaking the build settings in cmake
but to no avail
i even tried using vtk 5.0.4 but the same problem comes there too
i have tried on both windows and linux but the problem doesnt go away
here is the error message in full
Compiler: Default GCC compiler
Building Makefile: "D:\Projects\vtktest\Makefile.win"
Executing make...
mingw32-make.exe -f "D:\Projects\vtktest\Makefile.win" all
g++.exe -c trialFrm.cpp -o Objects/MingW/trialFrm.o -I"C:/Program
Files/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Program
Files/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Program
Files/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Program
Files/Dev-Cpp/include/c++/3.4.2" -I"C:/Program Files/Dev-Cpp/include"
-I"C:/Program Files/Dev-Cpp/" -I"C:/Program
Files/Dev-Cpp/include/common/wx/msw" -I"C:/Program
Files/Dev-Cpp/include/common/wx/generic" -I"C:/Program
Files/Dev-Cpp/include/common/wx/fl" -I"C:/Program
Files/Dev-Cpp/include/common/wx/gizmos" -I"C:/Program
Files/Dev-Cpp/include/common/wx/html" -I"C:/Program
Files/Dev-Cpp/include/common/wx/mmedia" -I"C:/Program
Files/Dev-Cpp/include/common/wx/net" -I"C:/Program
Files/Dev-Cpp/include/common/wx/ogl" -I"C:/Program
Files/Dev-Cpp/include/common/wx/plot" -I"C:/Program
Files/Dev-Cpp/include/common/wx/protocol" -I"C:/Program
Files/Dev-Cpp/include/common/wx/stc" -I"C:/Program
Files/Dev-Cpp/include/common/wx/svg" -I"C:/Program
Files/Dev-Cpp/include/common/wx/xml" -I"C:/Program
Files/Dev-Cpp/include/common/wx/xrc" -I"C:/Program
Files/Dev-Cpp/include/common/wx" -I"C:/Program
Files/Dev-Cpp/include/common" -I"C:/Program Files/Dev-Cpp/include/vtk"
-I"C:/Program Files/Dev-Cpp/include/vtk/Common" -I"C:/Program
Files/Dev-Cpp/include/vtk/Filtering" -I"C:/Program
Files/Dev-Cpp/include/vtk/GenericFiltering" -I"C:/Program
Files/Dev-Cpp/include/vtk/Graphics" -I"C:/Program
Files/Dev-Cpp/include/vtk/GUISupport" -I"C:/Program
Files/Dev-Cpp/include/vtk/Hybrid" -I"C:/Program
Files/Dev-Cpp/include/vtk/Imaging" -I"C:/Program
Files/Dev-Cpp/include/vtk/Infovis" -I"C:/Program
Files/Dev-Cpp/include/vtk/IO" -I"C:/Program
Files/Dev-Cpp/include/vtk/Parallel" -I"C:/Program
Files/Dev-Cpp/include/vtk/Rendering" -I"C:/Program
Files/Dev-Cpp/include/vtk/Utilities" -I"C:/Program
Files/Dev-Cpp/include/vtk/Views" -I"C:/Program
Files/Dev-Cpp/include/vtk/VolumeRendering" -I"C:/Program
Files/Dev-Cpp/include/vtk/Widgets" -I"C:/Program
Files/Dev-Cpp/include/vtk/Wrapping" -I"C:/Program
Files/VTK/include/vtk-5.2" -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__
-fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall
-D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -fexpensive-optimizations
-O3In file included from C:/Program
Files/Dev-Cpp/include/c++/3.4.2/backward/strstream:51,
from C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkIOStream.h:112,
from C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkSystemIncludes.h:40,
from C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkIndent.h:24,
from C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkObjectBase.h:43,
from C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkObject.h:41,
from C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkWindow.h:26,
from C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:41,
from win.h:4,
from trialFrm.h:24,
from trialFrm.cpp:10:
C:/Program Files/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one deprecated or
antiquated header. Please consider using one of the 32 headers found
in section 17.4.1.2 of the C++ standard. Examples include substituting
the <X> header for the <X.h> header for C++ includes, or <iostream>
instead of the deprecated header <iostream.h>. To disable this warning
use -Wno-deprecated.
trialFrm.cpp: In member function `void trialFrm::CreateGUIControls()':
trialFrm.cpp:57: error: cannot allocate an object of type
`renwin'trialFrm.cpp:57: error: because the following virtual
functions are abstract:C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:456: error:
virtual void vtkRenderWindow::SetDisplayId(void*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:457: error:
virtual void vtkRenderWindow::SetWindowId(void*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:459: error:
virtual void vtkRenderWindow::SetParentId(void*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:460: error:
virtual void* vtkRenderWindow::GetGenericDisplayId()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:461: error:
virtual void* vtkRenderWindow::GetGenericWindowId()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:462: error:
virtual void* vtkRenderWindow::GetGenericParentId()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:463: error:
virtual void* vtkRenderWindow::GetGenericContext()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:464: error:
virtual void* vtkRenderWindow::GetGenericDrawable()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:465: error:
virtual void vtkRenderWindow::SetWindowInfo(char*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:467: error:
virtual void vtkRenderWindow::SetParentInfo(char*)C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkWindow.h:69: error: virtual int*
vtkWindow::GetScreenSize()C:/Program
Files/Dev-Cpp/include/vtk/Common/vtkWindow.h:114: error: virtual
unsigned char* vtkWindow::GetPixelData(int, int, int, int,
int)C:/Program Files/Dev-Cpp/include/vtk/Common/vtkWindow.h:116:
error: virtual int vtkWindow::GetPixelData(int, int, int, int, int,
vtkUnsignedCharArray*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:471: error:
virtual void vtkRenderWindow::MakeCurrent()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:132: error:
virtual void vtkRenderWindow::Start()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:136: error:
virtual void vtkRenderWindow::Finalize()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:141: error:
virtual void vtkRenderWindow::Frame()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:159: error:
virtual void vtkRenderWindow::HideCursor()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:160: error:
virtual void vtkRenderWindow::ShowCursor()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:170: error:
virtual void vtkRenderWindow::SetFullScreen(int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:298: error:
virtual void vtkRenderWindow::WindowRemap()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:318: error:
virtual int vtkRenderWindow::SetPixelData(int, int, int, int, unsigned
char*, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:320: error:
virtual int vtkRenderWindow::SetPixelData(int, int, int, int,
vtkUnsignedCharArray*, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:328: error:
virtual float* vtkRenderWindow::GetRGBAPixelData(int, int, int, int,
int)C:/Program Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:330:
error: virtual int vtkRenderWindow::GetRGBAPixelData(int, int, int,
int, int, vtkFloatArray*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:332: error:
virtual int vtkRenderWindow::SetRGBAPixelData(int, int, int, int,
float*, int, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:334: error:
virtual int vtkRenderWindow::SetRGBAPixelData(int, int, int, int,
vtkFloatArray*, int, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:335: error:
virtual void vtkRenderWindow::ReleaseRGBAPixelData(float*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:337: error:
virtual unsigned char* vtkRenderWindow::GetRGBACharPixelData(int, int,
int, int, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:339: error:
virtual int vtkRenderWindow::GetRGBACharPixelData(int, int, int, int,
int, vtkUnsignedCharArray*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:342: error:
virtual int vtkRenderWindow::SetRGBACharPixelData(int, int, int, int,
unsigned char*, int, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:345: error:
virtual int vtkRenderWindow::SetRGBACharPixelData(int, int, int, int,
vtkUnsignedCharArray*, int, int)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:351: error:
virtual float* vtkRenderWindow::GetZbufferData(int, int, int,
int)C:/Program Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:352:
error: virtual int vtkRenderWindow::GetZbufferData(int, int, int,
int, float*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:354: error:
virtual int vtkRenderWindow::GetZbufferData(int, int, int, int,
vtkFloatArray*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:355: error:
virtual int vtkRenderWindow::SetZbufferData(int, int, int, int,
float*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:357: error:
virtual int vtkRenderWindow::SetZbufferData(int, int, int, int,
vtkFloatArray*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:413: error:
virtual int vtkRenderWindow::GetEventPending()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:458: error:
virtual void vtkRenderWindow::SetNextWindowId(void*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:466: error:
virtual void vtkRenderWindow::SetNextWindowInfo(char*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:494: error:
virtual int vtkRenderWindow::GetDepthBufferSize()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:499: error:
virtual int vtkRenderWindow::GetColorBufferSizes(int*)C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:528: error:
virtual void vtkRenderWindow::CheckGraphicError()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:532: error:
virtual int vtkRenderWindow::HasGraphicError()C:/Program
Files/Dev-Cpp/include/vtk/Rendering/vtkRenderWindow.h:536: error:
virtual const char*
vtkRenderWindow::GetLastGraphicErrorString()trialFrm.cpp:58: error:
'class renwin' has no member named 'show'mingw32-make.exe: ***
[Objects/MingW/trialFrm.o] Error 1Execution terminated
this error is from my try with windows using dev-cpp and mingw
on linux i tried with KDevelop
also this is the long form of the error message
if i have only added the lib and include folders
then the error is only about undefined reference to the QVTKWidget construtor
but if i add all the libraries inside the lib folder for linking i get
this long error
please help me i have seen some people on the mailing list having
similar problem
but no solutions
i have been stuck at this problem for the last 2 weeks
i have tried everything i could think of, am i missing some linking
option or something similar
any help would be much appreciated
thanks
More information about the vtkusers
mailing list