g_printf undefined?



I'm thinking of starting using GTK, but the fun stops pretty
quickly. Compiling this:

#include <glib.h>
#include <glib/gprintf.h>

int main() {
	g_printf("Hello world!\n");
    return(0);
}

with:

% gcc `pkg-config --cflags glib-2.0` -o hello hello.c

gives me:

/tmp/cc7MjZY1.o(.text+0x18): In function `main':
: undefined reference to `g_printf'
collect2: ld returned 1 exit status

I'm quoting my gprintf.h, just to be on the safe side:

gint g_printf (gchar const *format,
               ...) G_GNUC_PRINTF (1, 2);

Now why wouldn't this work?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]