GTK+ FAQ
<<< Previous | Development with GTK+: the begining | Next >>>

# I tried to compile a small Hello World of mine, but it failed. Any clue?

Since you are good at coding, we will not deal with compile time error here :)

The classic command line to compile a GTK+ based program is

`gcc -o myprog [c files] `gtk-config --cflags --libs``

You should notice the backquote character which is used in this command line. A common mistake when you start a GTK+ based development is to use quote instead of backquotes. If you do so, the compiler will complain about an unknown file called `gtk-config --cflags --libs`. The text in backquotes is an instruction to your shell to substitute the output of executing this text into the commandline.

The command line above ensure that:

- the correct C compiler flags will be used to compile the program (including the complete C header directory list)

- your program will be linked with the needed libraries.

<<< Previous | Home | Next >>>
How do I write security sensitive/SUID/SGID programs with GTK+? Is GTK+ secure? What's this GTK_MODULES security hole I heard about? | Up | What about using the make utility?