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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:56:53+00:00 2026-05-22T16:56:53+00:00

I am having a bear of a time getting autoconf to check for the

  • 0

I am having a bear of a time getting autoconf to check for the presence of a particular header file.

Let’s call the header dependency “inky.h”, and let’s say that inky is a library that was installed (seperately) with the prefix set to “/usr/local”. This put “inky.h” in /usr/local/inky/inky.h and libinky.so in /usr/local/lib.

Now, I’m trying to verify the presence of inky.h in my applications configure.ac as follows:

dnl # Setup temp LDFLAGS and look for inky library/header
LDFLAGS_SAVE=${LDFLAGS};
CPPFLAGS_SAVE=${CPPFLAGS};

dnl # Look for inky on the user specified inky install path
LDFLAGS ="-L${inky_library_path}";
CPPFLAGS="-I${inky_include_path}/inky";

AC_MSG_NOTICE([Looking for inky.h using: ${CPPFLAGS}]);

dnl # This check finds inky.h just fine.  This check was only used for debugging
AC_CHECK_FILE(
   [${inky_include_path}/inky/inky.h],
   [AC_MSG_NOTICE([Found inky.h])],
   [AC_MSG_NOTICE([Didn't find inky.h])]
   )

dnl # Look for the inky header file.  If it isn't found, terminate.
AC_CHECK_HEADER(inky.h,
    [],
    [AC_MSG_ERROR([Couldn't find or include inky.h])]
    )

This produces the following output from ./configure (after an autoreconf -vfi):

configure: Looking for inky.y in fetk include path: -I/usr/local/include/inky.y
checking for /usr/local/include/inky/inky.h... yes
configure: Found inky.h
checking inky.h usability... no
checking inky.h presence... yes
configure: WARNING: inky.h: present but cannot be compiled
configure: WARNING: inky.h:     check for missing prerequisite headers?
configure: WARNING: inky.h: see the Autoconf documentation
configure: WARNING: inky.h:     section "Present But Cannot Be Compiled"
configure: WARNING: inky.h: proceeding with the compiler's result
checking for inky.h... no
configure: error: Couldn't find or include inky.h

Now, this appears to be the case because inky.h includes 2 other headers, so I add them in on the fourth parameter of AC_CHECK_HEADER like so:

dnl # Look for the inky header file.  If it isn't found, terminate.
AC_CHECK_HEADER(inky.h,
    [],
    [AC_MSG_ERROR([Couldn't find or include inky.h])],
    [dinky.h plinky.h]
    )

Which renders this output from ./configure:

configure: Looking for inky in fetk include path: -I/usr/local/include/inky
checking for /usr/local/include/inky/inky.h... yes
configure: Found inky.h
checking for inky.h... no
configure: error: Couldn't find or include inky.h

I’m at my wits end with autoconf. Does anyone have any idea where I’m going wrong here. Is it possible to get configure to provide more details about what is failing? Why can I find the file itself, but the AC_CHECK_HEADER macro fails?

Also, please don’ tell me to use a different package distribution suite. I would never have chosen Autoconf myself, but I do have to add some dependencies to a pre-existing project.

Also note that the actual library is not named “inky.” However, there is an issue of “official use only” for this project, so I have changed the names to protect the…well, to protect myself!

[Edit – Closing]
Figured out the problem. See my answer.

  • 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-22T16:56:54+00:00Added an answer on May 22, 2026 at 4:56 pm

    I found what the issue was. The library that I am working with is a C library, but the “inky” library that I am linking against is a C++ library. So, the language (AC_LANG) was set to C early in the configure.ac script. While performing checks for “inky”, I needed to change the language to C++ so that Autoconf used the C++ compiler instead of the C compiler. This was done rather easily by using:

    AC_LANG_PUSH([C++])
    dnl # Do the checks for inky
    AC_LANG_POP([C++])
    

    This solved both the problem that I asked about in this thread, and on that I hand’t posted yet wherein I couldn’t get the AC_CHECK_LIB macro to work.

    Thank you everyone for your input.

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

Sidebar

Related Questions

I am having a bear of a time getting this to work. I have
I'm having a bear of a time trying to figure out why I'm getting
I'm having a difficult time expressing this problem, so bear with me and please
So, I have been having a bear of a time trying to troubleshoot why
I am having trouble getting some C code to run correctly (please bear with
I'm using LINQ to XML I'm having a bear of a time figuring out
I am having a bear of a time finding any updated JQGrid documentation. the
I am having a bear of a time saving the simplest record from a
fairly new to jQuery so bear with me. I am having trouble getting the
I'm having a tricky issue (bear with me as I'm new to MVC) with

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.