开发者

GTK+ gio No such file or directory

开发者 https://www.devze.com 2023-02-04 16:56 出处:网络
I\'m using VC++ 2008 and I\'ve the code: #include <gtk/gtk.h> int main( int argc, char *argv[]) { GtkWidget *window;

I'm using VC++ 2008 and I've the code:

#include <gtk/gtk.h>

int main( int argc, char *argv[])
{
  GtkWidget *window;

  gtk_init(&argc, &argv);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_widget_show(window);

  gtk_main();

  return 0;
}

And in every compiler i get same error: gio/gio.h: No such file or directory.

I've added this libs: gtk-win32-2.0.lib gdk-win32-2.0.lib gailutil.li开发者_StackOverflow中文版b

What else can i do?

EDIT: I've added includes and bins. The error is at gdkapplaunchcontext.h > line 30 > #include


You also need to install gtk includes (the folder with gtk.h) and specify that path in the Include paths of your compiler.


Also be aware that GTK depends on several other libraries, including gobject and glib. You will need to install them too.


To expand on what @ulidtko said, if you get this error in a typical GTK+ app you need to:

  1. Install the necessary libs. E.g. for Debian-based distros:

    sudo apt-get install libgtk2.0-dev

  2. Use the neccessary include paths and libs to compile. E.g. in your makefile:

    myprog : myprog.c gcc -o $@ $< $(shell pkg-config --libs --cflags gtk+-2.0) $(shell pkg-config --libs --cflags glib-2.0)

0

精彩评论

暂无评论...
验证码 换一张
取 消