0

I'm quite new to C++ and I aspire to learn gtkmm. I'm using linux mint 17.2 and Eclipse 3.8. When I enter:#include <gtkmm.h> the compiler will complain and give this error:

fatal error: gtkmm.h: No such file or directory

I've used synaptic and installed libgtkmm-3.0-dev and when I search for the header file locate gtkmm.h I get back the following path:

/usr/include/gtkmm-3.0/gtkmm.h

So, now if enter to eclipse #include gtkmm-3.0/gtkmm.h I get a new error: fatal error: glibmm.h: No such file or directory

locate glibmm.h 

shows me this path: /usr/include/glibmm-2.4/glibmm.h.

So if I enter again: #include <glibmm-2.4/glibmm.h>

I get back the same error. fatal error: glibmm.h: No such file or directory

So what am I missing here ?

Stefanos
  • 179
  • 1
  • 10
  • Do you mean #include ? You wrote #include gtkmm-3.0/gtkmm.h. – kometen Feb 07 '16 at 18:38
  • A yes.. sorry. It's a typo here, not in the code. – Stefanos Feb 07 '16 at 18:51
  • I don't know exactly how to tell Eclipse's build system where to find headers, though it should ideally involve pkg-config. But you should never put the gtkmm-3.0 part in the #include line of your C++ files. If your build system is working properly, a simple #include is all you need. – murrayc Feb 08 '16 at 11:20
  • The weird thing is that the same this happens with Code::Blocks (version 13.12)... I'm getting the same error: " fatal error: gtkmm.h: no such file or directory " I'm using GNU compiler. When you say involve pkg-config? – Stefanos Feb 08 '16 at 16:03
  • See the mention of pkg-config here: https://developer.gnome.org/gtkmm/stable/ . pkg-config is a very popular way to get the compiler and linker options you need to use a library. – murrayc Feb 09 '16 at 20:27
  • And this is probably a duplicate of this: http://stackoverflow.com/questions/26079171/setting-up-gtkmm-in-eclipse-for-c – murrayc Feb 09 '16 at 20:30

1 Answers1

1

OK I think I got it. in

Project->Properties -> C/C++ Build -> Settings ->GCC C++ Compiler-> Miscellaneous
you add `pkg-config --cflags gtkmm-3.0` in other flags.

In GCC/C++ Linker on Miscellaneous section you add `pkg-config --libs gtkmm-3.0` in other flags.

Now is GCC C++ Compiler again, on command line pattern you move the ${FLAGS} to the end.

It's working so far here.

Adam Ryczkowski
  • 7,592
  • 13
  • 42
  • 68
Stefanos
  • 179
  • 1
  • 10