Thanx again for posting the errors: it definitely helps!
Here are a couple of different suggestions:
1. Quotes vs back-quotes:
I'm concerned about this:
g++ 'gnome-config --cflags gnomemm' -Wall -g -c 'test6.cc' -o 'test6.o'
It should really say this:
g++ `gnome-config --cflags gnomemm` -Wall -g -c 'test6.cc' -o 'test6.o'
Do you have any idea what might account for the discrepency?
2. Is gnome-config (or gtk-config or pkg-config) really installed/configured?
Please try it from the command line
gnome-config --cflags gnomemm
3. Please post back what you find.
"apt", "yum", "yast" - you can ALWAYS fall back on "rpm"!
Speaking of which: it might not hurt to try this, too: