[Insight-users] help compile - link qtslicer qt4

Sergio Aguirre sergio.aguirre at gmail.com
Fri Mar 20 20:10:45 EDT 2009


Hello

I am trying to compile and test the qtsliceviewer application example
available at the* *[InsightApplications] / Auxiliary* / QtImage
Viewerdirectory.

Unfortunately, I get several

QtGlSliceView.cxx:(.text+0xbc2): undefined reference to `vtable for
QtGlSliceView'

messages and cant get to finish the build.

Any suggestions on building it correctly using qt 4 on a linux machine?

My Cmake file is shown below.

Sergio
#
cmake_minimum_required(VERSION 2.6)
PROJECT(QtSlicer)

INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/FindGLU.cmake)
#
#  Find where ITK was Built or Installed.
#
FIND_PACKAGE(ITK REQUIRED)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)

FIND_PACKAGE(Qt4 REQUIRED)

INCLUDE(${QT_USE_FILE})

MESSAGE(${QT_INCLUDE_DIR})

INCLUDE_DIRECTORIES(
 ${QT_INCLUDE_DIR}
 ${QT_INCLUDE_DIR}/Qt
 ${QtSlicer_BINARY_DIR}
 ${QtSlicer_SOURCE_DIR}
)

LINK_LIBRARIES(
  ${ITK_LIBRARIES}
  ${QT_QT_LIBRARY}
  ${GLU_LIBRARY}
  ${OPENGL_LIBRARY}
  ITKMetaIO
  ITKMetaIO
  itkzlib
  itkpng
  )

SET(QtSlicer_SRCS
  QtSlicerTest.cxx
  QtGlSliceView.cxx
  QtSlicer.cxx
)

QT4_AUTOMOC(${QtSlicer_SRCS})

QT4_WRAP_UI(QtSlicer_UIS_H
  QtSlicerGUI.ui
  QtSlicerHelpGUI.ui
  )

SET(QtSlicer_MOC_SRCS
  QtGlSliceView.h
)

ADD_DEFINITIONS(-DQT_DLL)

ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)

ADD_EXECUTABLE(QtSlicer
  ${QtSlicer_SRCS}
  ${QtSlicer_UIS_H}
  )

TARGET_LINK_LIBRARIES(QtSlicer
  ${QT_LIBRARIES}
  )

INSTALL_TARGETS(/bin QtSlicer)*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090320/fead30cd/attachment-0001.htm>


More information about the Insight-users mailing list