[CMake] cmake + Qt4 compilation problem

Luis Roberto P. Paula luisrpp at gmail.com
Tue Sep 9 02:35:23 EDT 2008


Oh... I left it commented just for testing. Wrong copy-paste... sorry.

But even if this line is not commented, the same error message is displayed.

On Tue, Sep 9, 2008 at 3:26 AM, Christian Ehrlicher <Ch.Ehrlicher at gmx.de>wrote:

> > Von: "Luis Roberto P. Paula"
> > Hello everyone!
> >
> > I'm trying to compile a simple application using Qt4 with cmake, but I'm
> > stucked in this error:
> >
> > [ 33%] Generating ui_mivgui.h
> > Scanning dependencies of target viewer
> > [ 66%] Building CXX object CMakeFiles/viewer.dir/main.o
> > [100%] Building CXX object CMakeFiles/viewer.dir/mivgui.o
> > Linking CXX executable viewer
> > CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::MivGui(QWidget*)':
> > mivgui.cxx:(.text+0x14e): undefined reference to `vtable for MivGui'
> > mivgui.cxx:(.text+0x158): undefined reference to `vtable for MivGui'
> > CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::MivGui(QWidget*)':
> > mivgui.cxx:(.text+0x2c6): undefined reference to `vtable for MivGui'
> > mivgui.cxx:(.text+0x2d0): undefined reference to `vtable for MivGui'
> > CMakeFiles/viewer.dir/mivgui.o: In function `MivGui::tr(char const*, char
> > const*)':
> > mivgui.cxx:(.text._ZN6MivGui2trEPKcS1_[MivGui::tr(char const*, char
> > const*)]+0x1e): undefined reference to `MivGui::staticMetaObject'
> > collect2: ld returned 1 exit status
> > make[2]: *** [viewer] Error 1
> > make[1]: *** [CMakeFiles/viewer.dir/all] Error 2
> > make: *** [all] Error 2
> >
> <snip>
> >
> > CMakeLists.txt
> >
> ----------------------------------------------------------------------------------------------------------------------------------------------
> >
> > SET(SOURCES_CPP
> >  main.cxx
> >  mivgui.cxx)
> > MESSAGE( STATUS ${SOURCES_CPP} )
> >
> > SET(SOURCES_H
> >  mivgui.h)
> > MESSAGE( STATUS ${SOURCES_H} )
> >
> > SET(SOURCES_UI
> >  mivgui.ui)
> > MESSAGE( STATUS ${SOURCES_UI} )
> >
> > FIND_PACKAGE(Qt4 REQUIRED)
> >
> > include(${QT_USE_FILE})
> >
> > QT4_WRAP_UI(SOURCES_UI_H ${SOURCES_UI})
> >
> > #qt4_automoc(${SOURCES_H})
> >
> Why did you comment out this line?
> You need to moc your header - otherwise you'll get linker errors like
> above.
>
>
> Christian
> --
> GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
> Jetzt dabei sein:
> http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080909/a9a6faea/attachment.htm>


More information about the CMake mailing list