ubuntu安裝mrpt的依賴wxWidgets報(bào)GSocket錯(cuò)
./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:
癥結(jié)在于gtk+與wxWindgets2.8.10中共同定義了 GSocket。
修改gtk+顯然不太合適,所以就改wxWidgets咯,修改一下wxWidgets的源代碼:
解決如下:
進(jìn)入wxwidgets的/src/gtk/gsockgtk.cpp
#define GSocket GlibGSocket //add
#include <gdk/gdk.h>
#include <glib.h>
#undef GSocket //add