News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Can't use gtkmm with Code::Blocks

Started by alexmmusic, August 27, 2022, 04:31:31 PM

Previous topic - Next topic

alexmmusic

Hi there!

I'm trying to learn gtkmm in Ubuntu, and I installed code::blocks because I don't want to compile with the terminal all the times.

I have tried to use the IDE for console app and it works fine, but when I try to use gtkmm it doesn't work because the compiler can't find the header files.

I'm sure I have installed gtkmm (I confirmed it with gpdk - L (...)).

In compiler settings -> Search directories I did include /usr/include/gtkmm-3.0 BUT I wrote it on my own because code::blocks didn't show it in the explorer (for sure the problem is related with it)

in Linker settings -> Other linker options I have this: `pkg-config gtkmm-3.0 --cflags --libs`

With all of this, the compiler still can't find the header files.

I have tried with #include <gtkmm-3.0/gtkmm.h> and #include <gtkmm.h> and none work.

I need help, I'm breaking my head with this.

Thanks a lot

Note: it compile and works in the terminal

Miguel Gimenez


alexmmusic


Miguel Gimenez


alexmmusic

Quote from: Miguel Gimenez on August 27, 2022, 05:35:12 PM
How did you install Code::Blocks?

via the elementary OS app center (I'm actually working with this OS)

stahta01

`pkg-config gtkmm-3.0 --cflags --libs`

The above is likely wrong!

What likely needs to be in compiler
`pkg-config gtkmm-3.0 --cflags`

What likely needs to be in linker
`pkg-config gtkmm-3.0 --libs`

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Onsemeliot

For gtkmm4 on Debian Trixie I used successfully:

in the other compiler options:
`pkg-config gtkmm-4.0 --cflags`

and in the other linker options:
`pkg-config gtkmm-4.0 --libs`

But I want to clarify that the backticks ` are obviously essential. It only works if they are included. I failed for a while until I finally added them.