Installing GTK

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
progproj

Installing GTK

Post by progproj »

I am a Linux newbie. I am running Mint and I want to develop GTK programs using C. I will need both GTK+2.0 and 3.0 to link to.
I am not sure if GTK is installed on my system. I have the headers but I don't see either the .c files or the object files.

I am completely new to Linux and I am not sure if every Linux install off the Debain branch already comes with GTK source and binaries installed or not. using locate I am able to find the .h files but scouring my computer, I don't find the .c or the binaries.

Issuing pkg-config --cflags gtk+-2.0 at the command line, I get back the following:

-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2

Going to these places, I find GTK .h files but no binaries. This seems strange to me. First, I can't recall if I used Synaptic Package Manager to download GTK files or not (unfortunately!) . I am now wondering if Mint just installs them in these places.

Does Mint use GTK for its own purposes and if so does that intersect with my development environment- for example should I just reuse the ones Mint comes with?

Either way, whether I retrieved them or Mint came with them I can't imagine how I ended up with just .h files. It feels wrong to me. I need the object files to link to , no?

Thanks in advance !
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Installing GTK

Post by Hoser Rob »

All the Mint editions except for KDE (which doesn;t exist in 19) are GTK based, so, yes, you have lots of GTK on your system. BTW if you';'re this much of a programming newbie, C is a very ppor choice for a beginner's language.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
progproj

Re: Installing GTK

Post by progproj »

I didn't say I was a beginner programmer. Please re-read the question.

" you have lots of GTK on your system" ..

If you can expand on that in a way which answers any of my questions, that would be great.


Is there some reason my Linux Mint 19 has only GTK headers and not object or c files? Is that expected?
gm10

Re: Installing GTK

Post by gm10 »

progproj wrote: Sat Dec 08, 2018 10:27 pm I am a Linux newbie. I am running Mint and I want to develop GTK programs using C. I will need both GTK+2.0 and 3.0 to link to.
I am not sure if GTK is installed on my system. I have the headers but I don't see either the .c files or the object files.
Ok, quick example/overview over Debian (or pretty much Linux in general) package structure:

libgtk-3-0 - compiled files, in this case pre-installed
libgtk-3-0-dev - headers so you can link to the compiled libraries, usually not pre-installed
gtk+3.0 - source package, certainly not needed to link to the libraries (why would you need the .c files for that?), doesn't get "installed" at all but can be downloaded, needs source repository enabled
progproj

Re: Installing GTK

Post by progproj »

Thank you those are good bits of information.

Is there a document / website which explains the relationship between a GTK programmer's build time information requirements (paths library llocations, header locations) and a typical Linux install system? For instance, I actually would not have known the names of the directories / .so you mentioned because I just haven't found information that specific- even in documentation / books; it seems like something I have to specifically know.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Installing GTK

Post by smurphos »

https://developer.gnome.org/gtk3/3.22/ is probably a good start.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
progproj

Re: Installing GTK

Post by progproj »

Thanks for the link to GTK's main documentation. That is useful information for someone trying to understand the API. I had actually already read the documentation, but it doesn't really answer my question. I appreciate the help.

This is a great forum and a great resource for Mint users.

Best of luck in everything!
Locked

Return to “Software & Applications”