Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03
How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1830002] Wed, 15 July 2020 15:25 Go to next message
Walter Williams is currently offline Walter WilliamsFriend
Messages: 3
Registered: July 2020
Junior Member
I am trying to setup Eclipse 2020 where I can build a GTK+ app. All the search results show unfamiliar dialog boxes with outdated instructions.

Where can I find instructions to do this?

WW.

EDIT:
I am using Debian Linux and I am seeking to do a C++ project.

[Updated on: Sat, 25 July 2020 20:34]

Report message to a moderator

Re: How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1830030 is a reply to message #1830002] Thu, 16 July 2020 04:20 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You don't say what kind of CDT project you are trying to use.
Nor have you told us what OS you are using.

Assuming Linux and have pkg-config available:
If you are using a Managed Build project, you need to tell the compiler what include paths to use.
The easiest way is to add `pkg-config --cflags gtk+-3.0 gtkmm-3.0` to the compiler command
and `pkg-config --libs gtk+-3.0 gtkmm-3.0` to the linker command
NOTE: those are surrounded by back-ticks and NOT single quotes.

If it's a Makefile project then you could create variables for them:
GTKCFLAGS:=$(shell pkg-config --cflags gtk+-3.0 gtkmm-3.0)
GTKLFLAGS:=$(shell pkg-config --libs gtk+-3.0 gtkmm-3.0)
Then use these variables in compile and link recipes.
(See the GNU Make manual for the difference between '=' and ':=')


The project I use is based on Autotools and likely won't help you much by showing it to you.

You will also need to tell the Indexer where the headers can be found.
That means manually adding the output from pkg-config to the CDT User Setting Entries of
Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entries tab

You may be able to get away with just:

  • /usr/include/gtk-3.0
  • /usr/include/glibmm-?.?
  • /usr/include/gtkmm-3.0
(or wherever pkg-config says they are)
depending on what you are doing.

[Updated on: Thu, 16 July 2020 04:40]

Report message to a moderator

Re: How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1830237 is a reply to message #1830030] Tue, 21 July 2020 14:27 Go to previous messageGo to next message
Helen Keller is currently offline Helen KellerFriend
Messages: 173
Registered: June 2019
Senior Member
Gentlemen,
I have been struggling with the same issue - mainly ancient "tutorials" .
Noting specific to Eclipse IDE.

I an essence - if it matter, and I think it should not matter WHAT type of C /C++ project is being build, - if I build plain C/C++ "hello world" , nothing " managed ' , and add pkg-config in options ( as suggested here ) I end up with "undefined references " to anything GTK.

There is something very basic missing in using pkg-config in Eclipse , and the real solution is to find out what because in principle pkg-config is no rocket science.
There got to be a simple way to integrate , and make them work , all these piece parts - Eclipse GCC make etc. unless "IDE" means noting to Eclipse.

Re: How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1830243 is a reply to message #1830237] Tue, 21 July 2020 20:42 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
There's little point in duplicating my response to two almost identical threads.
See: https://www.eclipse.org/forums/index.php?t=msg&th=1104577&goto=1830242&#msg_1830242

There is a pkg-config plugin in the Marketplace but its last update was over a year ago.
It seems to lack user interest.
I tried to use it once but it's just as easy to not use it.

Eclipse is getting too large.
One of the causes is trying to be everything to everyone no matter how small the niche.
It's rapidly becoming proof of Shaw's Principle: Build a system that even a fool can use, and only a fool will want to use it.




Re: How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1830277 is a reply to message #1830002] Wed, 22 July 2020 14:41 Go to previous messageGo to next message
Helen Keller is currently offline Helen KellerFriend
Messages: 173
Registered: June 2019
Senior Member
According to this 2018-09 is the only 20xx version supporting pkg-config.
It is unclear if one can roll his /hers own.

https://marketplace.eclipse.org/content/pkg-config-support-eclipse-cdt

Eclipse Versions:
Oxygen (4.7), Neon (4.6), Mars (4.5), Luna (4.4), Kepler (4.3), Juno (4.2, 3.8), Previous to Juno (<=4.1), Photon (4.8), 2018-09 (4.9)
Re: How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1830425 is a reply to message #1830030] Sat, 25 July 2020 20:35 Go to previous messageGo to next message
Walter Williams is currently offline Walter WilliamsFriend
Messages: 3
Registered: July 2020
Junior Member

My apologies. I am using Debian Linux and I am seeking to do a C++ project.
Re: How to use GTK+-3.0 or gtkmm library in Eclipse 2020-03 [message #1834383 is a reply to message #1830425] Mon, 09 November 2020 12:56 Go to previous message
Mark Smith is currently offline Mark SmithFriend
Messages: 82
Registered: September 2020
Member
Please check this https://www.eclipse.org/forums/index.php/t/199280/

[Updated on: Mon, 09 November 2020 12:56]

Report message to a moderator

Previous Topic:Build problem - missing #include file
Next Topic:Hello World in Assembly in Eclipse CDT: "make all" terminated with exit code 2
Goto Forum:
  


Current Time: Sun Dec 22 06:10:16 GMT 2024

Powered by FUDForum. Page generated in 0.03574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top