Netbeans #include gtk/gtk.h problem

Hello.

I am new to Linux and c++, actually before i have been programming a lot of VBA. Actually I have C experience, however, most C Programmers know that it is tricky to adjust the compiler settings so that everything works fine. When i try to do the usual programming, everything is no problem, the problem starts with GTK.

On my desktop i have Linux Mint, Netbeans 7.01 and C/C++ with gcc and so on.
Additionally I have installed gtk 3.0 and I have done so as described in the on the gtk homepage.

Now I tried to start a program and I have read through a lot of forum articles and tried out this and that for three days now. However I cannot get this gtk/gtk.h working.
There is always a yellow triangle and when I go on it I see:

"Cannot find include file <gtk/gtk.h>
For extra info hold Strg and move mouse over include directive"

There is also a compiler error:

"CLEAN SUCCESSFUL (total time: 59ms)
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
gcc gcc `pkg-config --cflags --libs gtk+-2.0` hello.c -o hello -c -g -I/usr/include -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.c
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
gcc: error: gcc: No such file or directory
gcc: error: hello.c: No such file or directory
make: *** [build/Debug/GNU-Linux-x86/main.o] Error 1

BUILD FAILED (exit value 2, total time: 69ms)"

My assumption is that the compiler does not find the gtk folder.

I have 2 GTK folders: under: /usr/lib/gtk-2.0 and /usr/lib/gtk-3.0, then under /usr/include/gtk-3.0.

What can I do that my "tin-idiot" (my computer) gets this gtk files, so that I can proceed programming gtk. I have already done this config recommendation, in the error message and as described in diverse forums. Please show me what exactly I make wrong.

Thanks in advance.
Last edited on
maybe change gtk+-2.0 to gtk+-3.0???
just guessing...
Thanks for the reply. I tried this and soething changed. The problem seems deeper though.
Now I get another message.
Besides it would be very nice if someone could tell me how to install such packages like gtk so that I do not have to adjust compiler settings for every new program.

CLEAN SUCCESSFUL (total time: 59ms)
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
gcc -c -g -I/usr/include -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.c
main.c:1:21: fatal error: gtk/gtk.h: No such file or directory
compilation terminated.
make: *** [build/Debug/GNU-Linux-x86/main.o] Error 1

BUILD FAILED (exit value 2, total time: 63ms)
Last edited on
Besides another question: where can I access this PKG_CONFIG_PATH environment variable. Sorry for my stupid questions here, but I am a VBA-Man.
Topic archived. No new replies allowed.