当我尝试编译我的应用程序时,出现以下错误。我已经使用 Homebrew 安装了所有依赖项,查看了“brew doctor”的输出,但不清楚如何解决这个问题。
$ gcc `pkg-config --cflags gtk+-3.0` -o gui gui.c `pkg-config --libs gtk+-3.0`
In file included from /usr/local/Cellar/glib/2.42.0/include/glib-2.0/glib/gtypes.h:32:0,
from /usr/local/Cellar/glib/2.42.0/include/glib-2.0/glib/galloca.h:32,
from /usr/local/Cellar/glib/2.42.0/include/glib-2.0/glib.h:30,
from /usr/local/Cellar/gtk+3/3.14.4/include/gtk-3.0/gdk/gdkconfig.h:13,
from /usr/local/Cellar/gtk+3/3.14.4/include/gtk-3.0/gdk/gdk.h:30,
from /usr/local/Cellar/gtk+3/3.14.4/include/gtk-3.0/gtk/gtk.h:30,
from gui.c:5:
/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include/glibconfig.h:12:19: fatal error: float.h: No such file or directory
和pkg-config --cflags gtk+-3.0
-D_REENTRANT -I/usr/local/Cellar/gtk+3/3.14.4/include/gtk-3.0 -I/usr/local/Cellar/at-spi2-atk/2.14.1/include/at-spi2-atk/2.0 -I/usr/local/Cellar/at-spi2-core/2.14.0/include/at-spi-2.0 -I/usr/local/Cellar/d-bus/1.8.8/include/dbus-1.0 -I/usr/local/Cellar/d-bus/1.8.8/lib/dbus-1.0/include -I/usr/local/Cellar/gtk+3/3.14.4/include/gtk-3.0 -I/usr/local/Cellar/glib/2.42.0/include/gio-unix-2.0/ -I/usr/local/Cellar/cairo/1.14.0/include/cairo -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/0.9.35_1/include/harfbuzz -I/usr/local/Cellar/pango/1.36.8/include/pango-1.0 -I/usr/local/Cellar/atk/2.14.0/include/atk-1.0 -I/usr/local/Cellar/cairo/1.14.0/include/cairo -I/usr/local/Cellar/pixman/0.32.6/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.11.1/include -I/usr/local/Cellar/freetype/2.5.3_1/include/freetype2 -I/usr/local/Cellar/libpng/1.6.13/include/libpng16 -I/usr/local/Cellar/gdk-pixbuf/2.30.8/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.13/include/libpng16 -I/usr/local/Cellar/glib/2.42.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.42.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/opt/X11/include
和pkg-config --libs gtk+-3.0
-L/usr/local/Cellar/gtk+3/3.14.4/lib -L/usr/local/Cellar/pango/1.36.8/lib -L/usr/local/Cellar/atk/2.14.0/lib -L/usr/local/Cellar/cairo/1.14.0/lib -L/usr/local/Cellar/gdk-pixbuf/2.30.8/lib -L/usr/local/Cellar/glib/2.42.0/lib -L/usr/local/opt/gettext/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
答案1
解决了问题,我使用以下内容来编译我的应用程序,我没有指定 vte 库。
clang -Wall -g gui.c -o guipkg-config --cflags --libs gtk+-3.0 vte