[Insight-users] problem linking InsightApplications/Auxiliary/QtGlSliceView'QtGLSliceView example

Matt McCormick matt at mmmccormick.com
Wed Nov 25 00:50:26 EST 2009


Sergio Aguirre <sergio.aguirre at ...> writes:

> 
> Hello I am trying to run the ITK-QT example code located in the repository
InsightApplications/Auxiliary/QtImageViewer directory. Unfortunately I keep
getting a link error  with the message below. After researching the error it
seems like there would be a virtual class definitions lacking. After reviewing 
the code I could not find anything apparently wrong. Any suggestions? Thank you
Sergio Linking CXX executable
QtSlicerCMakeFiles/QtSlicer.dir/QtGlSliceView.cxx.o: In function
`QtGlSliceView::~QtGlSliceView()':QtGlSliceView.cxx:(.text+0xbc2): undefined
reference to `vtable for QtGlSliceView'

Well, I have figured out how to compile it:
 diff --git a/QtGlSliceView.cxx b/QtGlSliceView.cxx
 index c218804..65bae97 100644
 --- a/QtGlSliceView.cxx
 +++ b/QtGlSliceView.cxx
 @@ -18,7 +18,7 @@
  #ifndef QtGlSliceView_cxx
  #define QtGlSliceView_cxx
  
 -#include "QtGlSliceView.h"
 +#include "QtGlSliceView.moc"
  #include "itkMinimumMaximumImageCalculator.h"
  #include <QMouseEvent>
  #include <QKeyEvent>

But it segfaults when an attempt is made to run it:
(gdb) run
Starting program: /home/matt/apps/qtslicerb/QtSlicer
[Thread debugging using libthread_db enabled]
(15543) findLibraryInternal: plugins should not have a 'lib' prefix:
"libkfilemodule.so"
(15543) KPluginLoader::load: The plugin "libkfilemodule" doesn't contain a
kde_plugin_verification_data structure
Done!

Program received signal SIGSEGV, Segmentation fault.
0x0000000000447ed9 in QtSlicer::SetInputImage (this=0x7fffffffce20,
newImData=0x7b2580) at /home/matt/apps/QtImageViewer/QtSlicer.cxx:46
(gdb) bt
#0  0x0000000000447ed9 in QtSlicer::SetInputImage (this=0x7fffffffce20,
newImData=0x7b2580) at /home/matt/apps/QtImageViewer/QtSlicer.cxx:
46
#1  0x000000000041fb18 in main (argc=1, argv=0x7fffffffd068) at
/home/matt/apps/QtImageViewer/QtSlicerTest.cxx:53
(gdb)




More information about the Insight-users mailing list