[Insight-users] itk qt problem - also with qmake

Philipp Farr Rainbowfrog at web.de
Wed Sep 14 15:37:40 EDT 2005


Hello , and thanks for your answers

I've got my qt program running with itk code now , using qmake .
My main mistake was that I tried to add libs this way:

LIBS += -L$C:/ITK/bin/Debug/-lITKAlgorithms

instead of this way:

LIBS += -L$C:/ITK/bin/Debug/-lITKAlgorithms

I also defined System variables making the lines look like that:

LIBS += $(ITK_DIR)/bin/Debug/ITKAlgorithms.lib

After that I had some further problems with the RTTI flag (which seems to be windows specific in this case) and the heap size ,I got messages like:

D:\Studium\Studienarbeit\ITK\SourceITK\InsightToolkit-2.0.1\Code\Common\itkEventObject.h(134) : warning C4541: 'dynamic_cast' fuer polymorphen Typ 'class itk::EventObject' mit /GR- verwendet; unvorhersehbares Verhalten moeglich
C:\Programme\Microsoft Visual Studio\VC98\INCLUDE\xstring(344) : fatal error C1076: Compiler-Beschraenkung: Interne Heap-Grenze erreicht; Verwenden Sie /Zm, um eine hoehere Grenze  anzugeben

I adjusted the heap size by filling in /Zm500 in the project properties of the visual studio and enabled the RTTI flag, now it seems to be working.
But I still failed to configure it with CMake ( just wanted to mention it, though I'm satisfied now, because I can go on working with qmake).
I used the CMakeLists below, with this Cmake will configure, but when I look at the advanced cache values it didn't find QT_QT_LIBRARY and visual studio won't compile later.
If I keep the CMakeLists like that and give CMake a path to qt-mtedu333.lib manually over the interface (which is in c:/qt/lib/3.3.3Educational/qt-mtedu333.lib ) I get the message:

FATAL_ERROR Cannot Build. Please set QT_QT_LIBRARY.

When I remove the part from "IF(NOT QT_QT_LIBRARY)" to "ENDIF(NOT QT_QT_LIBRARY)" from CMakeLists and provide the library over the Cmake interface , I get no error from Cmake but some unresolved external symbols about qt when compiling ... so I stopped trying.

Anyway, thanks for your help !

Philipp


##################################
#  CMakeLists.txt
##################################

PROJECT(MyProject)

INCLUDE (${CMAKE_ROOT}/Modules/FindOpenGL.cmake)

FIND_PACKAGE(ITK)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR
Cannot build without ITK. Please set ITK_DIR.)
ENDIF(ITK_FOUND)


INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)

INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${MyProject_BINARY_DIR}
${MyProject_SOURCE_DIR}
)

# this setting is QT and platform dependent!
# please adjust it to your own location of the QT-library
IF(NOT QT_QT_LIBRARY)
SET (QT_QT_LIBRARY c:/qt/lib/3.3.3Educational/qt-mtedu333.lib)
ELSE(NOT QT_QT_LIBRARY)
MESSAGE(FATAL_ERROR
Cannot Build. Please set QT_QT_LIBRARY.)
ENDIF(NOT QT_QT_LIBRARY)

LINK_LIBRARIES(
${ITK_LIBRARIES}
${QT_QT_LIBRARY}
${QT_GL_LIBRARY}
${OPENGL_LIBRARY}
)

SET(MyProject_SRCS
PicDisplay.h
PictureData.h
PicWidget.h
main.cxx
PicDisplay.cxx
PictureData.cxx
PicWidget.cxx
)

SET(MyProject_MOC_SRCS
PicDisplay.h
PictureData.h
PicWidget.h
)

ADD_EXECUTABLE(SegmItk1 main.cxx PicWidget.cxx PictureData.cxx PicDisplay.cxx)

# The moc files will be added to the library using the DestName source list.
IF(QT_WRAP_CPP)
QT_WRAP_CPP(MyProject MyProject_SRCS MyProject_MOC_SRCS )
ENDIF(QT_WRAP_CPP)


______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!		
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130



More information about the Insight-users mailing list