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>
&nbsp; FIND_PACKAGE(ITK)<br>
&nbsp; IF(ITK_FOUND)<br>
&nbsp;&nbsp;&nbsp; INCLUDE(${ITK_USE_FILE})<br>
&nbsp; ELSE(ITK_FOUND)<br>
&nbsp;&nbsp;&nbsp; MESSAGE(FATAL_ERROR<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;Cannot build InsightApplications without ITK.&nbsp; Please set
ITK_DIR.&quot;)<br>
&nbsp; 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>
#&nbsp; 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> &lt;<a href="mailto:jjomier@cs.unc.edu">jjomier@cs.unc.edu</a>&gt; 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>&gt; Hi,<br>&gt;<br>&gt; I have a problem when building the provided qtITK example. Namely, I
<br>&gt; receive the message<br>&gt;<br>&gt; CMake Error: can not find file /local/ghighi/code/workshop/itkqt/QtITK_SRCS<br>&gt;<br>&gt; when running ccmake .<br>&gt;<br>&gt; Here is my CMakeLists.txt file:<br>&gt;<br>&gt; --
<br>&gt; PROJECT(QtITKExample)<br>&gt;<br>&gt; IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<br>&gt;<br>&gt;&nbsp;&nbsp; FIND_PACKAGE(ITK)<br>&gt;&nbsp;&nbsp; IF(ITK_FOUND)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; INCLUDE(${ITK_USE_FILE})<br>&gt;&nbsp;&nbsp; ELSE(ITK_FOUND)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; MESSAGE(FATAL_ERROR
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&quot;Cannot build InsightApplications without ITK.&nbsp;&nbsp;Please set<br>&gt; ITK_DIR.&quot;)<br>&gt;&nbsp;&nbsp; ENDIF(ITK_FOUND)<br>&gt;<br>&gt; ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<br>&gt;<br>&gt; #<br>&gt; # Find QT<br>&gt; #
<br>&gt; INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake)<br>&gt;<br>&gt; INCLUDE_DIRECTORIES(<br>&gt; ${QT_INCLUDE_DIR}<br>&gt; ${QT_INCLUDE_PATH}<br>&gt; )<br>&gt;<br>&gt; LINK_LIBRARIES (<br>&gt; ITKIO<br>&gt; ${QT_QT_LIBRARY}
<br>&gt; )<br>&gt;<br>&gt; SET(QtITK_SRCS<br>&gt; itkQtProgressBar.cxx<br>&gt; qtITK.cxx<br>&gt; )<br>&gt;<br>&gt; SET(QtITK_MOC_SRCS<br>&gt; itkQtAdaptor.h<br>&gt; itkQtLightIndicator.h<br>&gt; )<br>&gt;<br>&gt; #IF(QT_WRAP_CPP)
<br>&gt;&nbsp;&nbsp; QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)<br>&gt; #ENDIF(QT_WRAP_CPP)<br>&gt;<br>&gt;<br>&gt; ADD_EXECUTABLE(QtITK QtITK_SRCS)<br>&gt;<br>&gt; #INSTALL_TARGETS(/bin QtITK)<br>&gt;<br>&gt;<br>&gt; --<br>&gt;<br>
&gt; I am using<br>&gt; ccmake version 2.2-patch 2<br>&gt;<br>&gt; Thanks,<br>&gt; --<br>&gt; Gheorghe<br>&gt;<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________
<br>&gt; Insight-users mailing list<br>&gt; <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>&gt; <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