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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:37:07+00:00 2026-05-21T11:37:07+00:00

Hi I am developing a C libtool library. I have an issue adding dependency

  • 0

Hi I am developing a C libtool library. I have an issue adding dependency lib xml2. I decide to use GNU autotools, bat I am very newbie.

In configure.ac I have:

# Checks for libraries.
AC_SEARCH_LIBS([xmlCleanupParser],[xml xml2])
AC_SEARCH_LIBS([xmlSAXVersion],[xml xml2])
AC_SEARCH_LIBS([xmlSAXUserParseFile],[xml xml2])

In MakeFile.ac:

nobase_include_HEADERS =  \
    foo.h \
    bar.h \
    foo/foo.h \
    foo/bar.h 

lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = \
    foo.c \
    bar.c \
        sax2.c \
    foo/foo.c \
    foo/bar.c 


check_PROGRAMS = test
test_SOURCES = test.c
test_LDADD = libfoo.la

The configure script output correctly:

checking for library containing xmlCleanupParser... -lxml2

In the generated Makefile there are:

LIBS = -lxml2 
...
libfoo.la: $(libfoo_la_OBJECTS) $(libfoo_la_DEPENDENCIES) 
$(LINK) -rpath $(libdir) $(libfoo_la_OBJECTS) $(libfoo_la_LIBADD) $(LIBS)

When I launch Make:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT bar.lo -MD -MP -MF .deps/bar.Tpo -c bar.c -o bar.o >/dev/null 2>&1
mv -f .deps/bar.Tpo .deps/bar.Plo
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT sax2.lo -MD -MP -MF .deps/sax2.Tpo -c -o sax2.lo sax2.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT sax2.lo -MD -MP -MF .deps/sax2.Tpo -c sax2.c  -fno-common -DPIC -o .libs/sax2.o
sax2.c:21:29: error: libxml/encoding.h: No such file or directory
sax2.c:22:31: error: libxml/xmlversion.h: No such file or directory
sax2.c:23:27: error: libxml/parser.h: No such file or directory
sax2.c:24:30: error: libxml/xmlmemory.h: No such file or directory
sax2.c:25:25: error: libxml/SAX2.h: No such file or directory
sax2.c:26:25: error: libxml/tree.h: No such file or directory
sax2.c:27:30: error: libxml/xmlstring.h: No such file or directory

The make command does not link the libxml2, anyone can help me please?

  • 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-21T11:37:07+00:00Added an answer on May 21, 2026 at 11:37 am

    Your problem is not with linking, but with compiling. Note how it says “compile” and then complains about missing header files. Those headers should be on your system under /usr/include/, so you should add -I/usr/include to the compilation command (whereas right now you have two -I options, for . and ..).

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

Sidebar

Related Questions

I am developing a new project, using Autotools for my build infrastructure. I would
Developing a project of mine I realize I have a need for some level
Developing a .net library based on an industry standard. The standard includes data structures
Developing an iPad website I tried to use the CSS property overflow: auto to
Developing Java, you have always learned that its best to create an ArrayList by
Developing ios app. I have an object class Product.h and .m respectively along with
While developing with Java in Eclipse it was very handy: you can attach sources
I'm developing a apache module and a shared library in the same Autoconf/Automake project.
Developing a bridge to use a cms with MongoDB I use a storage key,
Developing websites are time-consuming. To improve productivity, I would code a prototype to show

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.