我试图通过Linux应用程序的AIX Toolbox在我的IBM AIX7.1上安装GTK2。它为我提供了gtk2-2.24.30-2waixX11,因此我已通过rpm -i对其进行了安装。
现在我只有一个空的main.c,其中仅包含GTK2。
#include <gtk/gtk.h>
int main (int argc, char *argv[])
{
return 0;
}
当我尝试编译示例时,使用:
gcc -maix64 main.c `pkg-config --cflags gtk+-2.0`
它返回一个错误:
In file included from /usr/include/sys/thread.h:41:0,
from /usr/include/sys/ptrace.h:28,
from /usr/include/sys/proc.h:42,
from /usr/include/sys/pri.h:43,
from /usr/include/sys/sched.h:38,
from /usr/include/sched.h:51,
from /usr/include/pthread.h:63,
from /home/run/tools/include/glib-2.0/glib/deprecated/gthread.h:128,
from /home/run/tools/include/glib-2.0/glib.h:108,
from /home/run/tools/include/glib-2.0/gobject/gbinding.h:28,
from /home/run/tools/include/glib-2.0/glib-object.h:23,
from /home/run/tools/include/glib-2.0/gio/gioenums.h:28,
from /home/run/tools/include/glib-2.0/gio/giotypes.h:28,
from /home/run/tools/include/glib-2.0/gio/gio.h:26,
from /home/run/tools/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
from /home/run/tools/include/gtk-2.0/gdk/gdk.h:32,
from /home/run/tools/include/gtk-2.0/gtk/gtk.h:32,
from main.c:1:
/home/run/tools/include/gtk-2.0/gtk/gtktypeutils.h:61:24: error: expected ';', ',' or ')' before '.' token
gpointer func_data);
^
/home/run/tools/include/gtk-2.0/gtk/gtkwindow.h:443:36: error: expected ';', ',' or ')' before '.' token
gpointer func_data);
它在更多头文件上继续出现相同的错误。似乎gpointer对于GTK标头是未知的?我什至尝试将glib include添加到gtktypeutils.h中,将typedef void * gpointer定义添加到同一文件中,或者将gpointer更改为void *。总线总是返回相同的问题。
这是我的glib和gtk软件包:
rpm -qa | grep gtk
gtk2-2.24.30-2waixX11
gtk2-devel-2.24.30-2waixX11
rpm -qa | grep glib
glib2-2.56.1-2
glib2-devel-2.56.1-2
您有想法吗?谢谢,吉里。
答案 0 :(得分:0)
在AIX中,符号func_data
在/usr/include/sys/timer.h
中也定义为t_union.data
,除非您定义符号_LINUX_SOURCE_COMPAT
(我无法确定 other 的后果)此定义可能有):
gcc -maix64 main.c -D_LINUX_SOURCE_COMPAT `pkg-config --cflags gtk+-2.0`
或者,您可以编辑相关的头文件,如下所示:
perl -pi.bak -e 's/func_data/pfunc_data/g' \
$(grep -l func_data $(find pathto/gtk/ -name '*.h'))