<div dir="ltr">Oh... I left it commented just for testing. Wrong copy-paste... sorry.<br><br>But even if this line is not commented, the same error message is displayed.<br><br><div class="gmail_quote">On Tue, Sep 9, 2008 at 3:26 AM, Christian Ehrlicher <span dir="ltr">&lt;<a href="mailto:Ch.Ehrlicher@gmx.de">Ch.Ehrlicher@gmx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; Von: &quot;Luis Roberto P. Paula&quot;<br>
<div class="Ih2E3d">&gt; Hello everyone!<br>
&gt;<br>
&gt; I&#39;m trying to compile a simple application using Qt4 with cmake, but I&#39;m<br>
&gt; stucked in this error:<br>
&gt;<br>
&gt; [ 33%] Generating ui_mivgui.h<br>
&gt; Scanning dependencies of target viewer<br>
&gt; [ 66%] Building CXX object CMakeFiles/viewer.dir/main.o<br>
&gt; [100%] Building CXX object CMakeFiles/viewer.dir/mivgui.o<br>
&gt; Linking CXX executable viewer<br>
&gt; CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::MivGui(QWidget*)&#39;:<br>
&gt; mivgui.cxx:(.text+0x14e): undefined reference to `vtable for MivGui&#39;<br>
&gt; mivgui.cxx:(.text+0x158): undefined reference to `vtable for MivGui&#39;<br>
&gt; CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::MivGui(QWidget*)&#39;:<br>
&gt; mivgui.cxx:(.text+0x2c6): undefined reference to `vtable for MivGui&#39;<br>
&gt; mivgui.cxx:(.text+0x2d0): undefined reference to `vtable for MivGui&#39;<br>
&gt; CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::tr(char const*, char<br>
&gt; const*)&#39;:<br>
&gt; mivgui.cxx:(.text._ZN6MivGui2trEPKcS1_[MivGui::tr(char const*, char<br>
&gt; const*)]+0x1e): undefined reference to `MivGui::staticMetaObject&#39;<br>
&gt; collect2: ld returned 1 exit status<br>
&gt; make[2]: *** [viewer] Error 1<br>
&gt; make[1]: *** [CMakeFiles/viewer.dir/all] Error 2<br>
&gt; make: *** [all] Error 2<br>
&gt;<br>
</div>&lt;snip&gt;<br>
<div class="Ih2E3d">&gt;<br>
&gt; CMakeLists.txt<br>
&gt; ----------------------------------------------------------------------------------------------------------------------------------------------<br>
&gt;<br>
&gt; SET(SOURCES_CPP<br>
&gt; &nbsp;main.cxx<br>
&gt; &nbsp;mivgui.cxx)<br>
&gt; MESSAGE( STATUS ${SOURCES_CPP} )<br>
&gt;<br>
&gt; SET(SOURCES_H<br>
&gt; &nbsp;mivgui.h)<br>
&gt; MESSAGE( STATUS ${SOURCES_H} )<br>
&gt;<br>
&gt; SET(SOURCES_UI<br>
&gt; &nbsp;mivgui.ui)<br>
&gt; MESSAGE( STATUS ${SOURCES_UI} )<br>
&gt;<br>
&gt; FIND_PACKAGE(Qt4 REQUIRED)<br>
&gt;<br>
&gt; include(${QT_USE_FILE})<br>
&gt;<br>
&gt; QT4_WRAP_UI(SOURCES_UI_H ${SOURCES_UI})<br>
&gt;<br>
&gt; #qt4_automoc(${SOURCES_H})<br>
&gt;<br>
</div>Why did you comment out this line?<br>
You need to moc your header - otherwise you&#39;ll get linker errors like above.<br>
<br>
<br>
Christian<br>
<font color="#888888">--<br>
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!<br>
Jetzt dabei sein: <a href="http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx" target="_blank">http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx</a><br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</font></blockquote></div><br></div>