Re: Static Linking

On Tue, 18 Jul 2000, Elliot Yan wrote:

> I was reading w3c mailing and notice that you had a problem static
> linking w3c on linux.
> 
> I have the similar problem.  Could you share you solution if you found
> the fix ?

I hope you don't mind me posting this to the mailing list, but I
think others may benefit from this.

I realize that by describing my method, I may be shot by the libw3c
developers, but I'll take that risk.  My deadline was coming up, and
the -static flag was causing troubles with unresolved symbols.  I
thought that maybe the compiled versions were the cause, so I first
downloaded the source.  After recompiling w3c, I tried relinking my
program.  I was still getting unresolved symbols.  I searched by .a's
and specified all of them explicitly.  I was still getting unresolved
symbols in XML.  I placed the XML libraries in the link order several 
times and ended up with only more unresolved symbols.

The deadline was ticking (only hours away), so I looked carefully at
the unresolved symbols.  They were all in HTInit.c.  So, I went into
HTInit.c and commented out the usage of the unresolved symbols (I
don't have my source at this computer, sorry).  They all dealt with 
the initialization of XML related functionality (which I didn't need).
I recompilied w3c, relinked my executable, and ran my regression
tests.  Everything worked.

So, I resolved the unresolved symbols not by defining them, but by
removing the references.

Dave (ducking as not to be hit by flying bricks) Lacy Kusters

Received on Tuesday, 18 July 2000 16:17:54 UTC