Cannot create .moc files

View: New views
3 Messages — Rating Filter:   Alert me  

Cannot create .moc files

by alexandrm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all!

I started  learn about Qt4 and KDE4 and try to write my first app in KDE4.
Currently I have problems with creating .moc files.  For some reason .o files were
created successfully, but .moc were not created. I put kde4_automoc() in the CMakeLists.txt
but it doesn't work also. When I try to add #include "foo.moc" in the .cpp files the compiler complains
that it can't find "foo.moc" .

Can you please help me with this problem?

Thanks you

Re: Cannot create .moc files

by dukju ahn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2007/7/16, alexandrm <alexandrm77@...>:

>
> Hi all!
>
> I started  learn about Qt4 and KDE4 and try to write my first app in KDE4.
> Currently I have problems with creating .moc files.  For some reason .o
> files were
> created successfully, but .moc were not created. I put kde4_automoc() in the
> CMakeLists.txt
> but it doesn't work also. When I try to add #include "foo.moc" in the .cpp
> files the compiler complains
> that it can't find "foo.moc" .

kde4_automoc isn't needed anymore. I guess you forgot to add Q_OBJECT
macro in class declaration.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Re: Cannot create .moc files

by Elio Cuevas Gómez-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I had the same problem. I solved it by adding:
include_directories(${CMAKE_CURRENT_BINARY_DIR})
to CMakeList.txt. Don't forget to add #include "foo.moc" in your foo.cpp.You don't need KDE4_AUTOMOC anymore.

I hope this helps.

Elio.

2007/7/16, alexandrm <alexandrm77@...>:

Hi all!

I started  learn about Qt4 and KDE4 and try to write my first app in KDE4.
Currently I have problems with creating .moc files.  For some reason .o
files were
created successfully, but .moc were not created. I put kde4_automoc() in the
CMakeLists.txt
but it doesn't work also. When I try to add #include "foo.moc" in the .cpp
files the compiler complains
that it can't find "foo.moc" .

Can you please help me with this problem?

Thanks you
--
View this message in context: http://www.nabble.com/Cannot-create-.moc-files-tf4086307.html#a11614207
Sent from the kde-devel mailing list archive at Nabble.com.


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<