Yesss !!!
I did have such behavior once ago and on different static functions of KDE.
.
Code:
KMessageBox::messageBox( 0, KMessageBox::Error, QString, QString )
is in the same class and that works;
May be this function is only defined within KMainWindow ?