qt 与 x11 头文件同时引用

With the following includes:

#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>

I needed to undef a few definitions:

#undef Bool
#undef CursorShape
#undef Expose
#undef KeyPress
#undef KeyRelease
#undef FocusIn
#undef FocusOut
#undef FontChange
#undef None
#undef Status
#undef Unsorted

Of course add LIBS += -lX11 in your .pro file, and you are good to go!

posted @ 2020-03-31 17:38  Bigben  阅读(968)  评论(0)    收藏  举报