View Full Version : error: gtk/gtk.h: No such file or directory
October 9th, 2009, 01:10 AM
Hello, I've tried to compile a simple gtk+ program, using "code blocks", I always get the error:gtk/gtk.h: No such file or directory.
I installed the "libgtk2.0-dev" package, but still the problem continues,
October 9th, 2009, 01:43 AM
You need to specify to the compiler where it can find the gtk directory that contains gtk.h.
g++ -I/usr/include/gtk-2.0 MySource.cpp
gcc -I/usr/include/gtk-2.0 MySource.c
I haven't a clue how to use code-blocks, much less any desire to. So you will need to investigate on your own how to specify additional header file paths. If the gtk-2.0 libraries are not in /usr/lib, then you will also need to specify the path where these are located at. From the command line, the "-L" option is used to specify the path, and the "-l" (lowercase ell) is used to specify the library.
October 9th, 2009, 01:50 AM
Add the /usr/include/gtk-2.0 directory to the include search when compiling (Code::Blocks should have a place to put this somewhere).
On the command line, it would be done like this:
gcc -c -o program.o program.c -I/usr/include/gtk-2.0
October 9th, 2009, 10:02 AM
This may be silly of me but are you selecting GTK+ project from the new project menu?
I haven't had to install anything but I am able to compile straight away the gtk+ application from codeblocks (the example they provide on choosing gtk+ project).
Have you tried this? If this works it could be a mistype you made?
Sorry if this doesn't help.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.