[xml] Linking staticly against xml [OT]

Date view Thread view Subject view Author view

From: Rob van der Leek (r.vd.leek@fokkerspace.nl)
Date: Fri Dec 08 2000 - 10:59:15 EST


Hello list,

This message is completely off topic, I know, don't flame me for it. I'm
sorry to waste your time, but I'm very grateful for any hints on this.
The problem is that I want to link against the XML library staticly. I'm
running a CGI application on an Intel Linux box and the webserver
doesn't load libraries from /usr/local/lib. As you guessed, my
application uses libxml (2.2.9).
Suppose I have this test code:

main.cc

--
#include <iostream.h>

extern "C" { #include <libxml/parser.h> }

int main () { xmlDocPtr doc = xmlParseFile("t.xml"); return 0; } --

The following line should built a static binary: $ g++ -static -I/usr/local/include -L/usr/local/lib -lxml -o main main.cc

But instead returns: /tmp/ccUnSUvY.o: In function `main': /tmp/ccUnSUvY.o(.text+0xc): undefined reference to `xmlParseFile' collect2: ld returned 1 exit status

I compiled main.cc and checked the undefined symbols, they are: $ nm main.o 00000000 ? __FRAME_BEGIN__ U __throw 00000000 t gcc2_compiled. 00000000 T main U xmlParseFile

I checked the exported symbols in /usr/local/lib/libxml.a to be sure: $nm /usr/local/lib/libxml.a | grep xmlParseFile 0000e724 T xmlParseFile U xmlParseFile U xmlParseFile

These objects should link right? or not? I found a configure flag --with-gnu-ld but I have no idea what it exactly does and it doesn't fix my problem. TIA for you help.

Rob van der Leek ---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Dec 08 2000 - 11:43:54 EST