Author Topic: Codeblocks and GTKmm  (Read 7088 times)

PDEE

  • Guest
Codeblocks and GTKmm
« on: June 13, 2007, 08:25:23 pm »
Hi all, i am trying to get GTkmm to run with codeblocks on Ubuntu feisty. I have done a search on this very forum for an answer and i found that if i put these: `pkg-config glibmm-2.4 --cflags` `pkg-config glibmm-2.4 --libs` for the compiler and linker it should work, aswell as telling codeblocks where all the files are located...well...it won't work :( I have told codeblocks where to find atk, atkmm, cairomm, gconfmm, gdkmm, glibmm, gtk, gtkmm, and every other mm i can find, i won't list them all as there is quite a few. After telling codeblocks where all that lot is, it looks like it is starting to work and then i get undefined reference to Gtk::Main etc. It's the basic piece of code from the gtkmm website. Where am i going wrong? I have asked on ubuntuforums and someone told me i need gtk2, which i have already. Has anyone actually got this GUI kit working in codeblocks? If you have, how did you do it? I have been at this since yesterday morning, i feel like giving up but i want to get it working  :D If anyone has any idea i will be very very grateful.

Offtopic: great work mandrav, and all the other developers. I do actually look through the forums every day even though i don't log in that much. I can usually find the answer by looking.  :D

Offline Deschamps

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: Codeblocks and GTKmm
« Reply #1 on: June 14, 2007, 11:57:03 am »
Hello.

I suppose you've installed all the needed packages (their names could vary, both gtkmm2 and gtkmm2-devel here on my openSUSE 10.2, and all the related packages from their dependencies -i.e. glibmm2-devel, cairomm-devel, ... and so).

Quote
i found that if i put these: `pkg-config glibmm-2.4 --cflags` `pkg-config glibmm-2.4 --libs` for the compiler and linker it should work

I think that you should use gtkmm-2.4 as the reference package with pkg-config:

Code
deschamps@vulcano:~> pkg-config gtkmm-2.4 --cflags

-I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/gtkmm-2.4 -I/opt/gnome/lib/gtkmm-2.4/include -I/opt/gnome/include/glibmm-2.4 -I/opt/gnome/lib/glibmm-2.4/include -I/opt/gnome/include/gdkmm-2.4 -I/opt/gnome/lib/gdkmm-2.4/include -I/opt/gnome/include/pangomm-1.4 -I/opt/gnome/include/atkmm-1.6 -I/opt/gnome/include/gtk-2.0 -I/opt/gnome/include/sigc++-2.0 -I/opt/gnome/lib/sigc++-2.0/include -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include -I/opt/gnome/lib/gtk-2.0/include -I/opt/gnome/include/cairomm-1.0 -I/opt/gnome/include/pango-1.0 -I/opt/gnome/include/atk-1.0 

deschamps@vulcano:~> pkg-config gtkmm-2.4 --libs

-L/opt/gnome/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-x11-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lfreetype -lz -lfontconfig -lexpat -lglitz -lm -lpng12 -lXrender -lX11 -lpthread -lXau -lXdmcp 

This way worked fine for me compiling with C::B the minimal sample from gtkmm website.

Regards.


[attachment deleted by admin]
Those who were seen dancing were thought to be insane by those who could not hear the music

PDEE

  • Guest
Re: Codeblocks and GTKmm
« Reply #2 on: June 14, 2007, 12:43:35 pm »
Deschamps, thank you so much, i can't believe that's all i had to do. I didn't even have to tell codeblocks where all the other headers were, it found them all. It now works.  :P Thanks again.