Author Topic: How to compile GTKmm program under Debian?  (Read 5208 times)

Offline x153

  • Single posting newcomer
  • *
  • Posts: 6
How to compile GTKmm program under Debian?
« on: February 04, 2013, 11:42:47 am »
Hiho!

I have almost finished C++ basics and I'm heading now to learn some GUI things. I choose to learn some GTK or gtkmm in C++ case. I have installed libgtkmm-3.0-dev package, but sadly C::B is repporting error "<gtk/gtk.h> no such file or directory". What should I do to solve this problem?

Thanks a lot for your help!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
Re: How to compile GTKmm program under Debian?
« Reply #1 on: February 04, 2013, 11:57:32 am »
Read the FAQ at wiki.codeblocks.org
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline x153

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to compile GTKmm program under Debian?
« Reply #2 on: February 04, 2013, 12:52:09 pm »
That's too general for me :(. I don't know where should look for .h files (my libgtkmm is here: /usr/lib/x86_64-linux-gnu and I pasted that to settings->compiler->search directories) or what else can I do :/.

Could you explain me what to do step-by-step or give some hints which files should I look for and where exacly should I put them (as long as gtkmm is C++ library I think that I should stay with my gnu compiler and add paths to linker only, right?)

If that could help - my searching program can't find gtk.h file.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to compile GTKmm program under Debian?
« Reply #3 on: February 04, 2013, 01:25:24 pm »
If that could help - my searching program can't find gtk.h file.

If you don't have gtk.h on your system, it can not be found (obviously).

Install the package which includes the gtk.h you need (either gtk2 or gtk3).
It's up to you to find out which package is the correct one.

This website/forum is not dedicated to find out such stuff.
We can help to find the correct place in C::B to put the search path in.

For libraries you should always use pkg-config to set the needed variables or you will fail sooner or later, if a package is updated and some stuff changes.

Searching the forum for pkg-config should (hopefully) guide you to an explananation on how to use it correctly (at least in general, not for each and any special lib/toolkit of course).

Offline x153

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to compile GTKmm program under Debian?
« Reply #4 on: February 04, 2013, 01:56:25 pm »
It looks strange for me - I have installed gtkmm-3.0-dev, which should be (as gtkmm tutorial says) enough, but I can't find any gtk.h file.

And I'm a little bit confused - is it easier to use binaries or source than repo~ files?

And, more important, I should worry about IDE when I will be able to find gtk.h file?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to compile GTKmm program under Debian?
« Reply #5 on: February 04, 2013, 02:15:35 pm »
Use packages wherever possible, unless you really know what you do and you are an experienced developer.

If you have correctly installed gtkmm-3.0-dev it should be enough, because it depends on libgtk-3-dev, which includes gtk/gtk.h in it's own include folder. This is why you should use pkg-config, otherwise you will run into trouble sonner or later.

A quick forum search leads to this post: http://forums.codeblocks.org/index.php/topic,16880.msg114847.html#msg114847 (number 10 in result list).
It's about gtk2, but it's similar for all other libs.
But again, it's up to you to find out the details.

We can not teach how to use third-party libs/toolkits on this website 8as it is clearly stated in the forum rules), sorry.

Offline x153

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to compile GTKmm program under Debian?
« Reply #6 on: February 04, 2013, 03:20:23 pm »
Thanks for your help! I finally got basics examples working, all thanks to you :).