<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"><<a href="mailto:Ch.Ehrlicher@gmx.de">Ch.Ehrlicher@gmx.de</a>></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;">> Von: "Luis Roberto P. Paula"<br>
<div class="Ih2E3d">> Hello everyone!<br>
><br>
> I'm trying to compile a simple application using Qt4 with cmake, but I'm<br>
> stucked in this error:<br>
><br>
> [ 33%] Generating ui_mivgui.h<br>
> Scanning dependencies of target viewer<br>
> [ 66%] Building CXX object CMakeFiles/viewer.dir/main.o<br>
> [100%] Building CXX object CMakeFiles/viewer.dir/mivgui.o<br>
> Linking CXX executable viewer<br>
> CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::MivGui(QWidget*)':<br>
> mivgui.cxx:(.text+0x14e): undefined reference to `vtable for MivGui'<br>
> mivgui.cxx:(.text+0x158): undefined reference to `vtable for MivGui'<br>
> CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::MivGui(QWidget*)':<br>
> mivgui.cxx:(.text+0x2c6): undefined reference to `vtable for MivGui'<br>
> mivgui.cxx:(.text+0x2d0): undefined reference to `vtable for MivGui'<br>
> CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::tr(char const*, char<br>
> const*)':<br>
> mivgui.cxx:(.text._ZN6MivGui2trEPKcS1_[MivGui::tr(char const*, char<br>
> const*)]+0x1e): undefined reference to `MivGui::staticMetaObject'<br>
> collect2: ld returned 1 exit status<br>
> make[2]: *** [viewer] Error 1<br>
> make[1]: *** [CMakeFiles/viewer.dir/all] Error 2<br>
> make: *** [all] Error 2<br>
><br>
</div><snip><br>
<div class="Ih2E3d">><br>
> CMakeLists.txt<br>
> ----------------------------------------------------------------------------------------------------------------------------------------------<br>
><br>
> SET(SOURCES_CPP<br>
> main.cxx<br>
> mivgui.cxx)<br>
> MESSAGE( STATUS ${SOURCES_CPP} )<br>
><br>
> SET(SOURCES_H<br>
> mivgui.h)<br>
> MESSAGE( STATUS ${SOURCES_H} )<br>
><br>
> SET(SOURCES_UI<br>
> mivgui.ui)<br>
> MESSAGE( STATUS ${SOURCES_UI} )<br>
><br>
> FIND_PACKAGE(Qt4 REQUIRED)<br>
><br>
> include(${QT_USE_FILE})<br>
><br>
> QT4_WRAP_UI(SOURCES_UI_H ${SOURCES_UI})<br>
><br>
> #qt4_automoc(${SOURCES_H})<br>
><br>
</div>Why did you comment out this line?<br>
You need to moc your header - otherwise you'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>