Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6738845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:25:00+00:00 2026-05-26T11:25:00+00:00

I am using Eclipse CDT to develop a C software. I would like to

  • 0

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:

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                 

I am a freshman to C. Although I found some suggestions:

% gcc test.c -Wall -o test `pkg-config --cflags --libs glib-2.0`

But I do not know how to make it work through my Makefile:

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) $< -o $@
.cc.o:
        $(CXX) -c $(CXXFLAGS) $(DFLAGS) $(INCLUDES) $< -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

Could anybody help me? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:25:01+00:00Added an answer on May 26, 2026 at 11:25 am

    Append this at the end of your LIBS directive:

    $(shell pkg-config --libs glib-2.0)
    

    And this to your CXXFLAGS and CFLAGS:

    $(shell pkg-config --cflags glib-2.0)
    

    This will do the job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Eclipse CDT and I have a goto label and a
I've recently started using Eclipse Ganymede CDT for C development and I couldn't like
I have been using Eclipse CDT for some time now, and I love it,
I have successfully installed Eclipse 3.5 and Java 1.5. I would like to install
I am developing under Windows, and using Eclipse with CDT to develop C++ applications.
Qt Creator looks like a good IDE. I've been using Eclipse CDT and while
I am using eclipse cdt to develop a c++ program. One thing that drives
I am quite newbie in using eclipse cdt. I have a makefile project, and
I have installed Eclipse CDT, CodeSourcery G++ toolchain on Linux host. I am using
I'm setting up a C++ project, on Ubuntu x64, using Eclipse-CDT. I'm basically doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.