How to install glib-2.0, or what is the Mint equivalent.

Questions about applications and software
Forum rules
Before you post please read this

How to install glib-2.0, or what is the Mint equivalent.

Postby trideceth12 on Mon Nov 12, 2012 8:11 pm

I am trying to build xseticon (http://unix.stackexchange.com/a/55054/15359), as it is not in the mint repos.

However, simply running make returns a dependency error:

Code: Select all
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
gcc  -I /usr/X11R6/include -c xseticon.c -o xseticon.o
xseticon.c:23:18: fatal error: glib.h: No such file or directory
compilation terminated.
make: *** [xseticon.o] Error 1


I looked through the repos and didn't find any package which is obviously the equivalent of glib-2.0, how should I proceed??

NB. A few details:

My system: Mint 13, MATE 32bit

xseticon's Makefile:
Code: Select all
GLIB_CFLAGS=$(shell pkg-config --cflags glib-2.0)
  GLIB_LIBS=$(shell pkg-config --libs   glib-2.0)

XLIB_CFLAGS=-I /usr/X11R6/include

XLIB_LIBS=-L /usr/X11R6/lib -lX11 -lXmu

GD_LIBS=-lgd

LIBS=${GLIB_LIBS} ${XLIB_LIBS} ${GD_LIBS}

PREFIX=/usr/local
BINDIR=$(PREFIX)/bin

all: xseticon

xseticon.o: xseticon.c
   gcc ${GLIB_CFLAGS} ${XLIB_CFLAGS} -c $^ -o $@

xseticon: xseticon.o
   gcc ${LIBS} $^ -o $@

.PHONY: clean
clean:
   rm -f xseticon.o xseticon

.PHONY: install
install: xseticon
   install -d $(BINDIR)
   install -m 755 xseticon $(BINDIR)
Image
trideceth12
Level 1
Level 1
 
Posts: 3
Joined: Mon Nov 12, 2012 9:15 am

Linux Mint is funded by ads and donations.
 

Re: How to install glib-2.0, or what is the Mint equivalent.

Postby alainPannetier on Sat Jul 13, 2013 12:13 pm

1 - Regarding Dependencies

Code: Select all
sudo apt-get install libx11-dev
sudo apt-get install libxmu-dev
sudo apt-get install libgd2-xpm-dev


2 - Also: patch the Makefile
Depending on you gcc version, you might come across "undefined references".
In which case, you need to patch the makefile: at line 21, replace
Code: Select all
 gcc ${LIBS} $^ -o $@

with
Code: Select all
 gcc $^ -o $@ ${LIBS}

Should work.

3 - tip
Don't run sudo make install. Just stick xseticon binary in your $HOME/bin (already in your path of course).
So that you don't have to build xseticon again after your next Mint upgrade/installation.
Image
alainPannetier
Level 1
Level 1
 
Posts: 2
Joined: Mon Oct 22, 2012 7:11 am


Return to Software & Applications

Who is online

Users browsing this forum: gratua and 22 guests