Libxml2: undefined reference to xmlTextReaderConstName

Posted by Dmitry on Stack Overflow See other posts from Stack Overflow or by Dmitry
Published on 2012-06-22T18:44:24Z Indexed on 2012/06/23 3:16 UTC
Read the original article Hit count: 194

Filed under:
|
|

I have installed the latest libxml2-2.8.0, as usual: $ ./configure, $ make, $ make install.

The $ xml2-config --cflags --libs gives this output:

-I/usr/local/include/libxml2
-L/usr/local/lib -lxml2 -lm

But trying to compile any example...

$ gcc `xml2-config --cflags --libs` xmltest.c

The linker says:

/tmp/cc8ezrPl.o: In function `processNode':
xmltest.c:(.text+0x19): undefined reference to `xmlTextReaderConstName'
xmltest.c:(.text+0x38): undefined reference to `xmlTextReaderConstValue'

...etc.

Anything I've googled can be solved by xml2-config --cflags --libs flags, or upgrading to the latest version of libxml2, or something. Unfortunately, neither works for me.

What can be the steps to identify the problem?

Using Ubuntu 12.04 64-bit.

© Stack Overflow or respective owner

Related posts about gcc

Related posts about linker