ubuntu安裝mrpt的依賴wxWidgets報GSocket錯

ubuntu安裝mrpt的依賴wxWidgets報GSocket錯

./include/wx/gsocket.h:40: error: using typedef-name 'GSocket' after 'class'
/usr/include/glib-2.0/gio/giotypes.h:120: error: 'GSocket' has a previous declaration here
In file included from ./include/wx/gsocket.h:179,

    from ./src/gtk/gsockgtk.cpp:21:

癥結在于gtk+與wxWindgets2.8.10中共同定義了 GSocket。
修改gtk+顯然不太合適,所以就改wxWidgets咯,修改一下wxWidgets的源代碼:

解決如下:
進入wxwidgets的/src/gtk/gsockgtk.cpp
#define GSocket GlibGSocket //add
#include <gdk/gdk.h>
#include <glib.h>
#undef GSocket //add

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。