moc files

Matthias Hoelzer-Kluepfel mhk at caldera.de
Mon Aug 6 07:30:12 UTC 2001


On Sun, 5 Aug 2001, Victor [iso-8859-1] Röder wrote:

> first of all: after I've downloaded the changes of Matthias there were still
> some contradictions with the moc file includes. But this time my Makefiles
> were responsible for that. Therefore I changed them by hand :-|. Hmmm, maybe
> other people have "wrong" Makefiles, too and get into troubles when
> compiling. Is there a chance to get the "right" Makefiles into CVS? ( I don't
> know if they are there already, but if, why did I have the "wrong ones"?)

I guess you will have to do a "make clean; make force-reedit"
in that directories.

> > could someone help me understand, why this is the actual method handling
> > with moc files?
> > *Method A: The class declaration is found in a header (.h) file*
> > (the Makefile-method)
> > and
> > *Method B: The class declaration is found in an implementation ( .cpp)
> > file* (the #include-method)
>
> As mentioned there are two methods: the first one compiles the moc(.cpp)
> files and the cpp files separated and the second one includes the moc file
> into the matching cpp file and compiles only the cpp files. And not the moc
> files und cpp files separated.

Yes, these are the two ways that are in use. There are very
good arguments to include the moc files:

a) It is faster to compile, as the compiler has to parse the
header file only once.
b) The code size is (allegedly :) smaller
c) You can build more than one target in a directory

So it is a good idea to include the mocs instead of using the
moc.cpp approach.


Thanks,
Matthias.



-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list