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 7813291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:48:09+00:00 2026-06-02T04:48:09+00:00

My project depends upon a library (more precisely, GTK+) so I added the following

  • 0

My project depends upon a library (more precisely, GTK+) so I added the following configurations in my configure.ac:

PKG_CHECK_MODULES([GTK], [gtk+-2.0])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])

My Makefile.am is:

bin_PROGRAMS = secretary
secretary_SOURCES = secretary.c

For its turn, my secretary.c is as follows:

#include <gtk/gtk.h>

int main(int argc, char *argv[]) {
    gtk_init(&argc, &argv);
    GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_widget_show(window);
    gtk_main();
    return 0;
}

However, when I run make (of course, after calling ./configure) I got this error:

gcc -DHAVE_CONFIG_H -I. -g -O2 -MT secretary.o -MD -MP -MF \
   .deps/secretary.Tpo -c -o secretary.o secretary.c
secretary.c:1:21: fatal error: gtk/gtk.h: File or directory not found.

What am I missing? Why does autoconf not pass the correct flags to gcc?

  • 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-06-02T04:48:11+00:00Added an answer on June 2, 2026 at 4:48 am

    When you use PKG_CHECK_MODULES, you need to specify the flags in Makefile.am. The easiest way is to add it to AM_LDFLAGS and AM_CPPFLAGS:

    AM_LDADD = @GTK_LIBS@
    AM_CPPFLAGS = @GTK_CFLAGS@
    

    If you want to be more specific, you can instead add:

    secretary_LDADD = @GTK_LIBS@
    secretary_CPPFLAGS = @GTK_CFLAGS@
    

    It is probably easier to not use PKG_CHECK_MODULES at all and let the user specify the location of the libraries through the usual mechanism (assigning LDFLAGS or installing the libraries in a standard location).

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

Sidebar

Related Questions

I have a Python project which depends upon the wsgi_intercept package. I added it
I have a project that depends upon some other binaries to be downloaded from
I've a main project that depends on other Library projects that use external JARS
Suppose, I have an opensource project that depends on some library, that must be
I've developed a module for a Java project. The module depends on external library
My project depends on a 3rd party library that only has snapshots in its
I have two Eclipse projects: one that depends upon a certain library (android.jar) and
I'm installing otrfileconverter from the Guardian Project which depends upon the python modules potr
My project depends on library A in version n. It also depends on library
I have a project that depends on JBoss(specifically 5.1.0.GA) and I was playing around

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.