automoc4 issues ?

David Faure faure at kde.org
Mon Mar 9 23:38:28 CET 2009


On Monday 09 March 2009, Alexander Neundorf wrote:
> On Thursday 05 March 2009, Helio Chissini de Castro wrote:
> > On Thursday 05 of March 2009 16:11:22 Helio Chissini de Castro wrote:
> > > Hi
> > > I'm trying to use automoc in a plugin system and got some issues.
> > >
> > > I have:
> > >
> > > set( Core_SRCS editormanager/openeditorsview.cpp )
> > > set( Core_UI editormanager/openeditorsview.ui )
> > > set( Core_MOC_HDRS editormanager/openeditorsview.h )
> > > qt4_wrap_ui( Core_UI_SRCS ${Core_UI} )
> > > qt4_wrap_cpp( Core_MOC_SRCS ${Core_MOC_HDRS}
> > >
> > > *************************
> > >
> > > If i use:
> > >
> > > automoc4_add_library( Core SHARED ${Core_UI_SRCS} ${Core_SRCS} )
> > >
> > > i got
> > >
> > > [  0%] Building CXX object
> > > src/plugins/coreplugin/CMakeFiles/Core.dir/Core_automoc.cpp.o
> > > In file included from
> > > /home/lixo/packages/qt-creator/BUILD/qt-creator-1.0.0-
> > > src/build/src/plugins/coreplugin/moc_openeditorsview.cpp:11,
> > >                  from
> > > /home/lixo/packages/qt-creator/BUILD/qt-creator-1.0.0-
> > > src/build/src/plugins/coreplugin/Core_automoc.cpp:32:
> > > /home/lixo/packages/qt-creator/BUILD/qt-creator-1.0.0-
> > > src/build/src/plugins/coreplugin/../../../../src/plugins/coreplugin/edito
> > >rm anager/openeditorsview.h:71: error: 'OpenEditorsView' in namespace
> > > 'Core::Internal::Ui' does not name a type
> > >
> > > ****************************************
> > > if i use:
> > >
> > > add_library( Core SHARED ${Core_MOC_SRCS} ${Core_UI_SRCS} ${Core_SRCS} )
> > >
> > > it works.
> > >
> > > ****************************************
> > >
> > > Is there something missing ?
> >
> > Ok, David asked to to explain better the issue
> >
> > I'm trying to make a cmake build for a Qt only application, in this case
> > qt- creator
> >
> > One of the plugins, main one called coreplugin have some .ui forms too, and
> > i'm trying to use automoc4 to generate the plugin, but the above error
> > happens.
> 
> From your blog I assume you found the problem.
> What was wrong ?

He had foo.h: Q_OBJECT
and foo.cpp: Q_OBJECT
and foo.cpp was including foo.moc, but not moc_foo.moc.
So the moc file for the qobject in foo.cpp wasn't getting created.
I used kdelibs/kdeui/fonts/kfontcombobox.cpp as example to find out
he needed moc_foo.moc as well.

Sounds like a bug in automoc, actually, if it's not handling this case...

-- 
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kde-buildsystem mailing list