kde binary building is not portable :(
Lubos Lunak
l.lunak at suse.cz
Tue Nov 26 12:46:28 GMT 2002
On Monday 25 November 2002 16:32, Benjamin Reed wrote:
[snip]
>
> ...their change makes foo.cpp contain an "extern int kdemain()" as it's
> main function, and then the dummy files (foo_main.cpp and
> libfoo_main.cpp) actually each contain a main() that just call the
> kdemain().
Actually, kdeinit shouldn't call main(). Search for __KCC in
kdelibs/kinit/kinit.cpp . The simple reason why the code generated by KCC
aborts when main() is called second time is because one is not allowed by C++
standard to call main() twice (I don't know which section, I also think it
just simply says that main() can't be called recursively and a pointer to it
can't be taken).
In other words, main() should be called only once when starting application
(really starting, no dlopening or forking). libfoo_main.cpp should have e.g.
kdeinit_main().
--
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27 tel: +420 2 9654 2373
190 00 Praha 9 fax: +420 2 9654 2374
Czech Republic http://www.suse.cz/
More information about the kde-core-devel
mailing list