[vtkusers] undefined reference to 'QVTKWidget::QVTKWidget'
Yifei Li
yifli at mtu.edu
Tue Mar 24 10:47:38 EDT 2009
I fixed the problem by going into CMakeCache.txt and removing '/usr/bin'
mannually. However, I am still waiting for a solution to this problem.
I successfully built the example - SimpleView. But I'm still wondering
how come cmake can link libQVTKWidget.so without problems while qmake
can't??
Yifei
Yifei Li wrote:
> Hi all,
>
> I gave up using qmake and switched to cmake. However, when trying to
> compile the example /GUI/Qt/SimpleView, I still got the following
> error after typing 'cmake .':
>
> CMake Error: Error in cmake code at
> /home/grad/yifli/workspace/SimpleView/CMakeLists.txt:7:
> INCLUDE Could not find include file:
> /usr/bin/usr/lib/vtk-5.0/UseVTK.cmake
> Current CMake stack:
> [1] /home/grad/yifli/workspace/SimpleView/CMakeLists.txt
> -- Configuring done
>
> I checked the file /usr/lib/vtk-5.0/UseVTK.cmake is indeed there, I
> have no idea where the prefix '/usr/bin' comes from. How do I get rid
> of it?
> This is the first time I use cmake, so could someone help me out? Thanks
>
> Yifei
>
> Yifei Li wrote:
>> The undefined reference error occurred in ui_vtkgui.h (qvtkwidget =
>> new QVTKWidget(someParentWidget)), which is automatically generated
>> by qt/eclipse integration.
>> The other function qvtkwidget->GetRenderWindow() does not cause any
>> linking error.
>>
>> If I remove -lQVTK from 'LIBS', I'll get another linking error:
>> undefined reference to 'QVTKWidget::GetRenderWindow()'
>>
>> So I think the dynamic library libQVTK.so must be linked, at least
>> partially. I checked the symbols defined in libVTK.so using 'nm'
>> command and confirmed myself 'QVTKWidget' is
>> indeed defined:
>>
>> 0000b4d0 T _ZN10QVTKWidgetD0Ev
>> 0000b560 T _ZN10QVTKWidgetD1Ev
>> 0000b5e0 T _ZN10QVTKWidgetD2Ev
>> 00015a40 V _ZTI10QVTKWidget
>> 00012034 V _ZTS10QVTKWidget
>> 00015800 V _ZTV10QVTKWidget
>> 0000b4c0 T _ZThn40_N10QVTKWidgetD0Ev
>> 0000b550 T _ZThn40_N10QVTKWidgetD1Ev
>>
>> I'm running out of ideas. Who can help?
>>
>> Yifei
>>
>>
>> ----- Original Message -----
>> From: "Yifei Li" <yifli at mtu.edu>
>> To: vtkusers at vtk.org
>> Sent: Friday, March 20, 2009 3:02:55 PM GMT -05:00 US/Canada Eastern
>> Subject: [vtkusers] undefined reference to 'QVTKWidget::QVTKWidget'
>>
>> Hi all,
>>
>> I'm trying to compile an example of Qt4 and VTK integration -
>> SimpleView. Although I included all the libraries (I use qmake):
>> LIBS += -L/usr/lib \
>> -lQVTK \
>> -lvtkHybrid \
>> -lvtkVolumeRendering \
>> -lvtkIO \
>> -lvtkRendering \
>> -lvtkGenericFiltering \
>> -lvtkGraphics \
>> -lvtkImaging \
>> -lvtkFiltering \
>> -lvtkCommon \
>> -lvtkftgl \
>> -lvtkDICOMParser \
>> -lvtksys
>>
>> compilation still failed with the error message:
>> debug/vtkgui.o: In function `Ui_MainWindow::setupUi(QMainWindow*)':
>> undefined reference to `QVTKWidget::QVTKWidget(QWidget*,
>> QFlags<Qt::WindowType>)'
>>
>> Any Ideas? Thanks in advance
>>
>> Yifei
>>
>> P.S. Development Environment:
>> OS: Fedora 9
>> IDE: Eclipse 3.3.2
>> Compiler: g++ 4.3
>> Qt: 4.3
>> Qt/Eclipse integration for qt-4.5.0
>> VTK: 5.0
>>
>>
>> _______________________________________________
>> 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
>>
>
> _______________________________________________
> 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
More information about the vtkusers
mailing list