I am going to do the tutorials in "Foundations of GTK" book and I am wondering if my paths for compiling are setup correctly.
Where would I modify to include gtk.h.
My header currently uses the whole path to find gtk.h and that works.
It does not seem like this is correct as most tutorials use /gtk/gtk.h as the header path.
Am I doing the right thing?
/usr/local/include does not seem to be included in the compiler header path but /usr/include is.
It seems like my `pkgconf` part of my compile command may be wrong.
Can I get some guidance please. Most examples use gcc versus clang. Should I be using gcc?
Here is my compile command:
My first assignment:
Where would I modify to include gtk.h.
My header currently uses the whole path to find gtk.h and that works.
It does not seem like this is correct as most tutorials use /gtk/gtk.h as the header path.
Am I doing the right thing?
/usr/local/include does not seem to be included in the compiler header path but /usr/include is.
It seems like my `pkgconf` part of my compile command may be wrong.
Can I get some guidance please. Most examples use gcc versus clang. Should I be using gcc?
Here is my compile command:
cc `pkgconf --cflags gtk+-3.0` first.c -o first.app `pkgconf --libs gtk+-3.0` -rdynamic -Wall
My first assignment:
Code:
#include </usr/local/include/gtk-3.0/gtk/gtk.h>
int main(int argc, char *argv[]) {
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "First Project");
gtk_widget_show(window);
g_signal_connect(window, "destroy",
G_CALLBACK(gtk_main_quit), NULL);
gtk_main();
return 0;
}