error compiling KDE4 base ksysguard

David Faure faure at
Wed Jul 26 17:31:56 BST 2006

On Saturday 22 July 2006 18:27, Martin Koller wrote:
> Hi list,
> I'm trying to compile current kdebase but get the following strange error.
> I tried to find the problem in the code, but it seems I'm blind ...
> Any ideas ?

KFileDialog dlg( QString(), ... )
doesn't compile with gcc-3.something.

It's a complex C++ parsing issue, where the above could be either nested 
constructors (as the author intended) or a function declaration.
Although in most cases, because of the extra arguments (the "..."), it can't be
a function declaration, but gcc-3 doesn't notice that, only gcc-4 does.

The fix/workaround is to avoid nested constructors (when the first argument
is a constructor, like in the above case). E.g. by using QString:null.

In this particular case ( the code had other issues though
(creating an instance and then calling a static method on it?? Huh), so I'm fixing
it differently.

David Faure, faure at, sponsored by Trolltech to work on KDE,
Konqueror (, and KOffice (

More information about the kde-core-devel mailing list