Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install gtk development dependencies on Ubuntu?

Tags:

c

ubuntu

gtk

I have the code from GTK tutorial in base.c.

I am working on Ubuntu and when I compile using

$ gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`  

I get the following error

Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found base.c:1:20: fatal error: gtk/gtk.h: No such file or directory compilation terminated. 

Being new to linux, can someone help me in setting up the environment so that I can compile/run the program successfully?

like image 362
Kraken Avatar asked Mar 13 '13 15:03

Kraken


1 Answers

$ sudo apt-get install libgtk2.0-dev 

Generally speaking to build things based on libfoo, you need libfoo-dev.

In addition, to install anything that is needed to build a package, say gedit, you can run:

$ sudo apt-get build-dep gedit 

Searching http://packages.ubuntu.com/ or Synaptic can help.

like image 119
poolie Avatar answered Sep 29 '22 06:09

poolie