Hi there,
I am new to the CodeBlocks forum. I could not find a solution to my problem by searching the forum.
The problem is:
I have created a new GTK project using the "New Project Wizard".When I try to compile I get the error "fatal error: 'gtk/gtk.h' file not found"
(output of "Build messages" window):
||=== Build: Debug in gtk-test (compiler: GNU GCC Compiler) ===|
/Users/jh/prog/gtk-test/main.c|2|fatal error: 'gtk/gtk.h' file not found|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I do have `pkg-config gtk+-2.0 --cflags` in "Project build options":
<see attachment "screenshot_project-options.png">
But apparently pkg-config is not called by the compiler
(output of "Build log" window):
-------------- Build: Debug in gtk-test (compiler: GNU GCC Compiler)---------------
gcc -Wall -g -c /Users/jh/prog/gtk-test/main.c -o Debug/main.o
/Users/jh/prog/gtk-test/main.c:2:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
1 error generated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
When I run "pkg-config gtk+2 --cflags" inside Terminal the response seems reasonable to me:
<see attachment "screenshot_pkg-config-in-terminal.png">
When I change `pkg-config gtk+-2.0 --cflags` in the "Project build options", e.g. remove the backticks, I get (expected) errors.
(output of "Build Messages" window):
-------------- Build: Debug in gtk-test (compiler: GNU GCC Compiler)---------------
gcc -Wall pkg-config gtk+-2.0 --cflags -g -c /Users/jh/prog/gtk-test/main.c -o Debug/main.o
clang: error: unsupported option '--cflags'
clang: error: no such file or directory: 'pkg-config'
clang: error: no such file or directory: 'gtk+-2.0'
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
So it seems that the contents of "Other options" are processed by CodeBlocks.
I use CodeBlocks 13.12 on a Macbook "Late 2008" running OSX 10.9.5 (Mavericks).
I have installed the GTK libs etc. via Macports and I am able to compile and link applications via a Makefile in Terminal.
Btw. how do I add a screenshot (or any other image) inline in a post? The "Insert Image" button just adds
tags to the text.
Do I have to set some additional configurations in CodeBlocks?
Is there the possibility to set custom search directories for a certain type (e.g. GTK) of project?
Where and how would I do this?
Please advise.
Thanks al lot!
Johannes