title: How to config glib in Makefile?
body: <p>I am using Eclipse CDT to develop a C software. I would like to use glib, but it always reports "Unresolved inclusion: ". I have installed glib on my ubuntu:</p>
  
  <pre><code>carl@Carl:~$ dpkg -l | grep libglib
  ii  libglib-perl                          2:1.223-1        
  ii  libglib2.0-0                          2.28.6-0ubuntu1      
  ii  libglib2.0-bin                        2.28.6-0ubuntu1      
  ii  libglib2.0-cil                        2.12.10-1ubuntu1       
  ii  libglib2.0-data                       2.28.6-0ubuntu1        
  ii  libglib2.0-dev                        2.28.6-0ubuntu1       
  ii  libglib2.0-doc                        2.28.6-0ubuntu1       
  ii  libglibmm-2.4-1c2a                    2.28.0-1                 
  </code></pre>
  
  <p>I am a freshman to C. Although I found some suggestions:</p>
  
  <pre><code>% gcc test.c -Wall -o test `pkg-config --cflags --libs glib-2.0`
  </code></pre>
  
  <p>But I do not know how to make it work through my Makefile:</p>
  
  <pre><code>CC=         gcc
  CXX=        g++
  CFLAGS=     -ggdb -g -Wall -O2
  CXXFLAGS=   $(CFLAGS)
  DFLAGS=     -DHAVE_PTHREAD #-D_FILE_OFFSET_BITS=64
  OBJS=       rand.o
  PROG=       peta
  INCLUDES=   
  LIBS=       -lm -lz -lpthread -Lbwt_gen -lbwtgen
  SUBDIRS=    . bwt_gen
  
  .SUFFIXES:.c .o .cc
  
  .c.o:
          $(CC) -c $(CFLAGS) $(DFLAGS) $(INCLUDES) $&lt; -o $@
  .cc.o:
          $(CXX) -c $(CXXFLAGS) $(DFLAGS) $(INCLUDES) $&lt; -o $@
  
  all:$(PROG)
  
  lib-recur all-recur clean-recur cleanlocal-recur install-recur:
          @target=`echo $@ | sed s/-recur//`; \
          wdir=`pwd`; \
          list='$(SUBDIRS)'; for subdir in $$list; do \
              cd $$subdir; \
              $(MAKE) CC="$(CC)" CXX="$(CXX)" DFLAGS="$(DFLAGS)" CFLAGS="$(CFLAGS)" \
                  INCLUDES="$(INCLUDES)" $$target || exit 1; \
              cd $$wdir; \
          done;
  
  lib:
  
  peta:lib-recur $(OBJS) main.o
          $(CC) $(CFLAGS) $(DFLAGS) $(OBJS) main.o -o $@ $(LIBS)
  
  cleanlocal:
          rm -f gmon.out *.o a.out $(PROG) *~ *.a
  
  clean:cleanlocal-recur
  </code></pre>
  
  <p>Could anybody help me? Thanks.</p>