When I include QCustomeplot and nurses.h into my project, they seems incompitible, my environment is
Ubuntu20.04+Qt5.12.8+CMake 3.28
the compiler error are below
[main] Building folder: Lidar [build] Starting build [proc] Executing command: /usr/local/bin/cmake --build /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/build --config Debug --target all -j 18 -- [build] [ 6%] Automatic MOC for target lidar_Perception [build] [ 6%] Built target lidar_Perception_autogen [build] [ 13%] Building CXX object CMakeFiles/lidar_Perception.dir/lidar_Perception_autogen/mocs_compilation.cpp.o [build] [ 20%] Building CXX object CMakeFiles/lidar_Perception.dir/main.cpp.o [build] [ 26%] Building CXX object CMakeFiles/lidar_Perception.dir/mainwindow_lidar.cpp.o [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextcursor.h:46, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qlineedit.h:45, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QLineEdit:1, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:19, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:816:25: error: macro "border" requires 8 arguments, but only 1 given [build] 816 | inline qreal border() const [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/curses.h:1229: note: macro "border" defined here [build] 1229 | #define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) [build] | [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextcursor.h:46, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qlineedit.h:45, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QLineEdit:1, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:19, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:816:25: error: macro "border" requires 8 arguments, but only 1 given [build] 816 | inline qreal border() const [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/curses.h:1229: note: macro "border" defined here [build] 1229 | #define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) [build] | [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/QtGui:10, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupportDepends:4, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:3, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/qcustomplot.h:92, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:23, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qbackingstore.h:74:52: error: macro "scroll" passed 3 arguments, but takes just 1 [build] 74 | bool scroll(const QRegion &area, int dx, int dy); [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/curses.h:1222: note: macro "scroll" defined here [build] 1222 | #define scroll(win) wscrl(win,1) [build] | [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/QtGui:10, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupportDepends:4, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:3, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/qcustomplot.h:92, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:23, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qbackingstore.h:74:52: error: macro "scroll" passed 3 arguments, but takes just 1 [build] 74 | bool scroll(const QRegion &area, int dx, int dy); [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/curses.h:1222: note: macro "scroll" defined here [build] 1222 | #define scroll(win) wscrl(win,1) [build] | [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsanchorlayout.h:44, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QtWidgets:99, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupportDepends:5, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:3, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/qcustomplot.h:92, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:23, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsitem.h:347:66: error: macro "scroll" passed 3 arguments, but takes just 1 [build] 347 | void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF()); [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/curses.h:1222: note: macro "scroll" defined here [build] 1222 | #define scroll(win) wscrl(win,1) [build] | [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsanchorlayout.h:44, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QtWidgets:99, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupportDepends:5, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:3, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/qcustomplot.h:92, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:23, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsitem.h:347:66: error: macro "scroll" passed 3 arguments, but takes just 1 [build] 347 | void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF()); [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/curses.h:1222: note: macro "scroll" defined here [build] 1222 | #define scroll(win) wscrl(win,1) [build] | [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextcursor.h:46, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qlineedit.h:45, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QLineEdit:1, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:19, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:816:5: error: ‘border’ declared as an ‘inline’ field [build] 816 | inline qreal border() const [build] | ^~~~~~ [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:816:18: error: expected ‘;’ at end of member declaration [build] 816 | inline qreal border() const [build] | ^~~~~~ [build] | ; [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:817:5: error: expected unqualified-id before ‘{’ token [build] 817 | { return doubleProperty(FrameBorder); } [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgesture.h:267:16: error: ‘stdscr’ is not a type [build] 267 | static int timeout(); [build] | ^~~~~~~ [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgesture.h:267:16: error: expected identifier before ‘(’ token [build] 267 | static int timeout(); [build] | ^~~~~~~ [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsanchorlayout.h:44, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QtWidgets:99, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupportDepends:5, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:3, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/qcustomplot.h:92, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:23, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.cpp:1: [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsitem.h:347:10: error: variable or field ‘scroll’ declared void [build] 347 | void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF()); [build] | ^~~~~~ [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextcursor.h:46, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qlineedit.h:45, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QLineEdit:1, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:19, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:816:5: error: ‘border’ declared as an ‘inline’ field [build] 816 | inline qreal border() const [build] | ^~~~~~ [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:816:18: error: expected ‘;’ at end of member declaration [build] 816 | inline qreal border() const [build] | ^~~~~~ [build] | ; [build] /usr/include/x86_64-linux-gnu/qt5/QtGui/qtextformat.h:817:5: error: expected unqualified-id before ‘{’ token [build] 817 | { return doubleProperty(FrameBorder); } [build] | ^ [build] In file included from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:27, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgesture.h:267:16: error: ‘stdscr’ is not a type [build] 267 | static int timeout(); [build] | ^~~~~~~ [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgesture.h:267:16: error: expected identifier before ‘(’ token [build] 267 | static int timeout(); [build] | ^~~~~~~ [build] In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsanchorlayout.h:44, [build] from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QtWidgets:99, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupportDepends:5, [build] from /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport/QtPrintSupport:3, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/qcustomplot.h:92, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/ui_fusionView.h:23, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/fusionView.h:15, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/mainwindow_lidar.h:29, [build] from /home/hitbuyi/AD_Projects/Vis_Projects/Lidar/main.cpp:3: [build] /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qgraphicsitem.h:347:10: error: variable or field ‘scroll’ declared void [build] 347 | void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF()); [build] | ^~~~~~ [build] make[2]: *** [CMakeFiles/lidar_Perception.dir/build.make:104: CMakeFiles/lidar_Perception.dir/mainwindow_lidar.cpp.o] Error 1 [build] make[2]: *** Waiting for unfinished jobs.... [build] make[2]: *** [CMakeFiles/lidar_Perception.dir/build.make:90: CMakeFiles/lidar_Perception.dir/main.cpp.o] Error 1
It seems both them have some macros or function names, how to solve this problem?