You are not logged in.

#1 2011-02-09 19:46:56

retznto
Member
Registered: 2010-11-21
Posts: 9

[SOLVED] Problems with libxml2

I've been trying to build a package which has dependencies requiring libxml2, but I've been having problems.

When I build the package, I get the following errors:

/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderExpand@LIBXML2_2.5.7'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlParseMemory@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libbonoboui-2.so: undefined reference to `xmlFree@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlStrcasecmp@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlNodeGetContent@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libbonoboui-2.so: undefined reference to `xmlStrdup@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderRead@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderConstName@LIBXML2_2.6.0'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderGetAttribute@LIBXML2_2.5.0'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlGetProp@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderDepth@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderValue@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderConstXmlLang@LIBXML2_2.6.0'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlNodeListGetString@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libbonoboui-2.so: undefined reference to `xmlParseDocument@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlNewTextReaderFilename@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderSetStructuredErrorHandler@LIBXML2_2.6.6'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlFreeDoc@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderNodeType@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderIsEmptyElement@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlGetLineNo@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderName@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libbonoboui-2.so: undefined reference to `xmlCreateMemoryParserCtxt@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlKeepBlanksDefault@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlStrcmp@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlReaderForFd@LIBXML2_2.6.0'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlDocGetRootElement@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderRelaxNGValidate@LIBXML2_2.5.7'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libbonoboui-2.so: undefined reference to `xmlFreeParserCtxt@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderIsValid@LIBXML2_2.5.7'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libbonoboui-2.so: undefined reference to `xmlCreateFileParserCtxt@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlLineNumbersDefault@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlTextReaderCurrentNode@LIBXML2_2.5.0'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlFreeTextReader@LIBXML2_2.4.30'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgnomevfs-2.so: undefined reference to `xmlTextReaderConstValue@LIBXML2_2.6.0'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/../../../libgtksourceview-2.0.so: undefined reference to `xmlSubstituteEntitiesDefault@LIBXML2_2.4.30'
collect2: ld returned 1 exit status

After looking around, general advice is to have libxml2 installed, but it's already installed. I've tried reinstalling, but with no luck.

If anyone has any ideas about how I can fix this, they would be much appreciated.

Last edited by retznto (2011-02-13 01:19:20)

Offline

#2 2011-02-09 19:55:15

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,937
Website

Re: [SOLVED] Problems with libxml2

you are looking in the wrong place. THe package that you are trying to build is buggy and is broken because of --as-needed flag.

simply add this line before ./configure

unset LDFLAGS

Give what you have. To someone, it may be better than you dare to think.
Blog

Offline

#3 2011-02-09 20:19:15

retznto
Member
Registered: 2010-11-21
Posts: 9

Re: [SOLVED] Problems with libxml2

Just tried putting it into the PKGBUILD (I tried before autoconf.sh, configure and make), but with no success.

I also found this elsewhere in the forums:

export LDFLAGS="${LDFLAGS//-Wl,--as-needed}"

but that hasn't worked either.

Last edited by retznto (2011-02-09 20:45:53)

Offline

#4 2011-02-12 10:41:36

retznto
Member
Registered: 2010-11-21
Posts: 9

Re: [SOLVED] Problems with libxml2

Bumping this in the hope that someone might be able to help. The package maintainer was able to build the package fine, so it could be something to do with my installation. If it's needed, that package I'm trying to build is here: http://aur.archlinux.org/packages.php?ID=33764

Offline

#5 2011-02-12 18:52:04

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,937
Website

Re: [SOLVED] Problems with libxml2

i think is something wrong with your libxml2. reinstall it


Give what you have. To someone, it may be better than you dare to think.
Blog

Offline

#6 2011-02-12 20:44:54

retznto
Member
Registered: 2010-11-21
Posts: 9

Re: [SOLVED] Problems with libxml2

I tried several times using several methods (overwriting the installation, removing and installing as new), but everything gave the same error. I'm stuck for what could be causing the error sad

Offline

#7 2011-02-13 00:48:45

retznto
Member
Registered: 2010-11-21
Posts: 9

Re: [SOLVED] Problems with libxml2

I believe I have found the source of the problem. The original command it was failing on was this:

libtool: link: g++ -Wall -Werror -g -O2 -rdynamic -o gloobus-preview gloobus-preview-main.o gloobus-preview-window.o gloobus-preview-config.o gloobus-preview-plugin-manager.o gloobus-preview-interface-main.o gloobus-preview-interface-default.o gloobus-preview-interface-image.o gloobus-preview-interface-text.o gloobus-preview-interface-media.o gloobus-preview-interface-document.o gloobus-preview-interface-list.o gloobus-preview-interface-free.o gloobus-preview-theme.o gloobus-preview-toolbar.o gloobus-preview-singleton.o -pthread -pthread -pthread  -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgconf-2 -lgtksourceview-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lm -lcairo -lpng14 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lbz2 -lpthread -ldl -pthread

When in the source folder, pasting this gave the errors. Adding the -lxml2 flag to the end of it complies it successfully.

My question now, is why is it working fine for everyone else, but not me? Is it something to do with configure or autotools? And is there any way to add this flag into the makepkg process, as I try to stay away from 'make install'-ing things.

Last edited by retznto (2011-02-13 01:01:54)

Offline

#8 2011-02-13 00:57:33

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,097
Website

Re: [SOLVED] Problems with libxml2

Check to make sure you've got pkg-config installed.

Offline

#9 2011-02-13 01:04:31

retznto
Member
Registered: 2010-11-21
Posts: 9

Re: [SOLVED] Problems with libxml2

pkg-config is installed, and reinstalling it doesn't seem to make a difference.

Offline

#10 2011-02-13 01:18:50

retznto
Member
Registered: 2010-11-21
Posts: 9

Re: [SOLVED] Problems with libxml2

Success! Adding CXXFLAGS=-lxml2 to the configure line in the PKGBUILD has the software working perfectly. I have no idea if it's OK to do that, but it seems to work now, so I'm not complaining.

I'll let the package maintainer know, but it's a weird one, as noone else seems to have needed to do it.

Offline

#11 2014-05-13 13:30:42

sydm
Member
Registered: 2014-05-13
Posts: 1

Re: [SOLVED] Problems with libxml2

had the same problem on ubuntu
This is a linker error as it cannot find the definitions for the functions.
This link should explain the issue:
libxml link error

Last edited by sydm (2014-05-13 13:31:43)

Offline

#12 2014-05-13 16:15:58

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,349

Re: [SOLVED] Problems with libxml2

Do not necrobump, this issue is long, long dead.

https://wiki.archlinux.org/index.php/Fo … Bumping.22

Last edited by Scimmia (2014-05-13 16:16:41)

Offline

#13 2014-05-13 16:38:29

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,805

Re: [SOLVED] Problems with libxml2

sydm,

Welcome to Arch Linux.  Do be careful about resurrecting old posts.  Note that this one was tagged as solved more than three years ago.  I don't even recall the last time I saw a post from retznto.  Wonder and Falconindy are still with us though.

I am going to go ahead and close this thread now.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB