GTK Programming - gtk disappears?
Hello,
I am a beginning programmer, trying to learn C and GTK. I started a tutorial and made it through the first two lessons, then on the third received a curious error: Code:
fatal error: gtk/gtk.h: No such file or directory compilation terminated. Thanks for any help with this. :) |
Hi there,
Quote:
#include "gtk/gtk.h" starts searching from the directory that contains the C source file #include <gtk/gtk.h> starts searching from the compiler's default or configured include directory Right now, that's all I can think of as a reason. [X] Doc CPU |
Also, compare the compiler commandline arguments. If you are using make to build the program, the arguments may be embedded in the Makefile. Look especially for the '-I' (uppercase 'eye') argument, possibly embedded in something like ${CFLAGS}.
--- rod. |
Quote:
Code:
#include <gtk/gtk.h> Quote:
Code:
gcc codename.c -o programname Thanks to both of you for your help. This problem seems quite perplexing; I hope I don't have to backup and do a re-install. :( I at least wish I knew what I did to make the headers "disappear" so I don't pull that one again. |
Quote:
|
If the aforementioned tutorial is online, please post a link to it. If you are too new here to post links, send me a private LQ message with the link, and I'll post it if it works.
--- rod. |
For GTK+ you generally use `pkg-config --cflags gtk+-2.0` in the gcc call, in addition to your own options. Similarly, you'd use `pkg-config --libs gtk+-2.0` to get linker flags. Keep in mind that both provide flags corresponding to the configuration of your GTK+ installation; therefore, code the `...` into your makefile, not the output of the respective commands. So something like this, if you compile and link at the same time:
Code:
gcc `pkg-config --cflags gtk+-2.0` codename.c -o programname `pkg-config --libs gtk+-2.0` |
Quote:
Quote:
|
No problem. I did think it was slightly strange, though, as you said you'd been able to build other GTK+ programs without any trouble.
|
All times are GMT -5. The time now is 04:53 PM. |