Hi Julien, <br>
<br>
Thanks alot for the help!<br>
<br>
Now I seem to have some linking problems. I should mention that I am
using ccmake version 2.2-patch 2 and I receive the following errors:<br>
<br>
--<br>
Linking CXX executable QtITK<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorD1Ev+0x13):
In function `itk::QtLightIndicator::~QtLightIndicator()':<br>
: undefined reference to `vtable for itk::QtLightIndicator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorD1Ev+0x1f):
In function `itk::QtLightIndicator::~QtLightIndicator()':<br>
: undefined reference to `vtable for itk::QtLightIndicator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk12QtTranslatorD2Ev+0xb): In function `itk::QtTranslator::~QtTranslator()':<br>
: undefined reference to `vtable for itk::QtTranslator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk15QtSignalAdaptor10EmitSignalEv+0xd):
In function `itk::QtSignalAdaptor::EmitSignal()':<br>
: undefined reference to `itk::QtTranslator::Signal()'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk12QtTranslatorC2Ev+0x1d): In function `itk::QtTranslator::QtTranslator()':<br>
: undefined reference to `vtable for itk::QtTranslator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorC1EP7QWidgetPc+0x1e):
In function `itk::QtLightIndicator::QtLightIndicator(QWidget*, char*)':<br>
: undefined reference to `vtable for itk::QtLightIndicator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZN3itk16QtLightIndicatorC1EP7QWidgetPc+0x2a):
In function `itk::QtLightIndicator::QtLightIndicator(QWidget*, char*)':<br>
: undefined reference to `vtable for itk::QtLightIndicator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0xc):
undefined reference to `itk::QtTranslator::className() const'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x10):
undefined reference to `itk::QtTranslator::qt_cast(char const*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x14):
undefined reference to `itk::QtTranslator::qt_invoke(int, QUObject*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x18):
undefined reference to `itk::QtTranslator::qt_emit(int, QUObject*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x1c):
undefined reference to `itk::QtTranslator::qt_property(int, int,
QVariant*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0xc):
undefined reference to `itk::QtTranslator::className() const'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x10):
undefined reference to `itk::QtTranslator::qt_cast(char const*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x14):
undefined reference to `itk::QtTranslator::qt_invoke(int, QUObject*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x18):
undefined reference to `itk::QtTranslator::qt_emit(int, QUObject*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTVN3itk15QtSignalAdaptorE+0x1c):
undefined reference to `itk::QtTranslator::qt_property(int, int,
QVariant*)'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.t._ZNK3itk12QtTranslator10metaObjectEv+0x7):
In function `itk::QtTranslator::metaObject() const':<br>
: undefined reference to `itk::QtTranslator::staticMetaObject()'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTIN3itk15QtSignalAdaptorE+0x8):
undefined reference to `typeinfo for itk::QtTranslator'<br>
CMakeFiles/QtITK.dir/qtITK.o(.gnu.linkonce.r._ZTIN3itk13QtSlotAdaptorINS_14AddImageFilterINS_5ImageIfLj2EEES3_S3_EEEE+0x8):
undefined reference to `typeinfo for itk::QtTranslator'<br>
collect2: ld returned 1 exit status<br>
make[2]: *** [QtITK] Error 1<br>
make[1]: *** [CMakeFiles/QtITK.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
--<br>
<br>I have seen you mention that this was a known problem with CMake
2.0.2 not wrapping cpp for Qt, so I uncommented the relevant lines. So
now my CMakeLists.txt looks like this:<br>
<br>
--<br>
PROJECT(QtITKExample)<br>
<br>
#IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<br>
<br>
FIND_PACKAGE(ITK)<br>
IF(ITK_FOUND)<br>
INCLUDE(${ITK_USE_FILE})<br>
ELSE(ITK_FOUND)<br>
MESSAGE(FATAL_ERROR<br>
"Cannot build InsightApplications without ITK. Please set
ITK_DIR.")<br>
ENDIF(ITK_FOUND)<br>
<br>
#ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<br>
<br>
#<br>
# Find QT<br>
#<br>
INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)<br>
<br>
INCLUDE_DIRECTORIES(<br>
${QT_INCLUDE_DIR}<br>
${QT_INCLUDE_PATH}<br>
)<br>
<br>
LINK_LIBRARIES (<br>
ITKIO<br>
ITKCommon<br>
ITKBasicFilters<br>
ITKAlgorithms<br>
ITKIO<br>
itkpng<br>
itkzlib<br>
${QT_QT_LIBRARY}<br>
)<br>
<br>
SET(QtITK_SRCS<br>
itkQtProgressBar.cxx<br>
qtITK.cxx<br>
)<br>
<br>
SET(QtITK_MOC_SRCS <br>
itkQtAdaptor.h<br>
itkQtLightIndicator.h<br>
)<br>
<br>
#IF(QT_WRAP_CPP)<br>
# QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)<br>
#ENDIF(QT_WRAP_CPP)<br>
<br>
QT_WRAP_CPP(QtITK ${QtITK_SRCS} ${QtITK_MOC_SRCS})<br>
ADD_EXECUTABLE(QtITK ${QtITK_SRCS})<br>
<br>
#ADD_EXECUTABLE(QtITK QtITK_SRCS)<br>
<br>
#INSTALL_TARGETS(/bin QtITK)<br>
--<br>
<br>
Thanks for the help,<br>
<br><div><span class="gmail_quote">On 11/16/05, <b class="gmail_sendername">Julien Jomier</b> <<a href="mailto:jjomier@cs.unc.edu">jjomier@cs.unc.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Gheorghe,<br><br>Try to replace<br><br>QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)<br>ADD_EXECUTABLE(QtITK QtITK_SRCS)<br><br>by<br><br>QT_WRAP_CPP(QtITK ${QtITK_SRCS} ${QtITK_MOC_SRCS})<br>ADD_EXECUTABLE(QtITK ${QtITK_SRCS})
<br><br>Let us know if that works or not. I'll put a fix as soon as I can.<br><br>Thanks for the report,<br><br>Julien<br><br>Gheorghe Postelnicu wrote:<br>> Hi,<br>><br>> I have a problem when building the provided qtITK example. Namely, I
<br>> receive the message<br>><br>> CMake Error: can not find file /local/ghighi/code/workshop/itkqt/QtITK_SRCS<br>><br>> when running ccmake .<br>><br>> Here is my CMakeLists.txt file:<br>><br>> --
<br>> PROJECT(QtITKExample)<br>><br>> IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<br>><br>> FIND_PACKAGE(ITK)<br>> IF(ITK_FOUND)<br>> INCLUDE(${ITK_USE_FILE})<br>> ELSE(ITK_FOUND)<br>> MESSAGE(FATAL_ERROR
<br>>
"Cannot build InsightApplications without ITK. Please set<br>> ITK_DIR.")<br>> ENDIF(ITK_FOUND)<br>><br>> ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<br>><br>> #<br>> # Find QT<br>> #
<br>> INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)<br>><br>> INCLUDE_DIRECTORIES(<br>> ${QT_INCLUDE_DIR}<br>> ${QT_INCLUDE_PATH}<br>> )<br>><br>> LINK_LIBRARIES (<br>> ITKIO<br>> ${QT_QT_LIBRARY}
<br>> )<br>><br>> SET(QtITK_SRCS<br>> itkQtProgressBar.cxx<br>> qtITK.cxx<br>> )<br>><br>> SET(QtITK_MOC_SRCS<br>> itkQtAdaptor.h<br>> itkQtLightIndicator.h<br>> )<br>><br>> #IF(QT_WRAP_CPP)
<br>> QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)<br>> #ENDIF(QT_WRAP_CPP)<br>><br>><br>> ADD_EXECUTABLE(QtITK QtITK_SRCS)<br>><br>> #INSTALL_TARGETS(/bin QtITK)<br>><br>><br>> --<br>><br>
> I am using<br>> ccmake version 2.2-patch 2<br>><br>> Thanks,<br>> --<br>> Gheorghe<br>><br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> Insight-users mailing list<br>> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>> <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users
</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Gheorghe Postelnicu, PhD<br>MGH, Harvard Medical School