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
网友评论