Bug 373585

Summary: There is a naming conflict between QX11Info and kwindowsystem
Product: [Frameworks and Libraries] frameworks-kwindowsystem Reporter: Emmanuel Lepage Vallée <emmanuel.lepage>
Component: generalAssignee: Martin Flöser <mgraesslin>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kdelibs-bugs-null, mpyne
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Emmanuel Lepage Vallée 2016-12-12 20:23:17 UTC
I try to get fix startup notification (it's totally broken) and got this error. I don't know if you care enough about X11 or Qt plugin naming conflict to fix this (I didn't check if it can be done without breaking the API). But better document this somewhere. Feel free to close this bug if you don't care.


In file included from $SRC/desktop/mainwindow.cpp:86:0:
/usr/include/kstartupinfo.h:38:14: error: conflicting declaration 'typedef void Display'
 typedef void Display;
              ^
In file included from /usr/include/qt5/QtX11Extras/QX11Info:1:0,
                 from $SRC/desktop/mainwindow.cpp:85:
/usr/include/qt5/QtX11Extras/qx11info_x11.h:40:26: note: previous declaration as 'typedef struct _XDisplay Display'
 typedef struct _XDisplay Display;
                          ^
$SRC/desktop/mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
$SRC/desktop/mainwindow.cpp:93:60: error: request for member 'id' in 'id', which is of non-class type 'KStartupInfoId()'
Comment 1 Michael Pyne 2016-12-13 02:00:51 UTC
Is the /usr/include/kstartupinfo.h from KDE 4 or earlier?  I just checked in the KF5::KWindowSystem repository and the kstartupinfo.h defines Display as

    typedef struct _XDisplay Display;

just as QX11Info appears to.  And this isn't a recent fix, it's defined this way for as far back as the git repo has existed (since it was forked from the old kdelibs).  Maybe this is just a local misconfiguration?
Comment 2 Emmanuel Lepage Vallée 2016-12-13 02:40:28 UTC
Possible, sorry about that, it would not be the first time my system pick the wrong header. I have to be more careful when writing my test CMakeList.