[Expat-discuss] Re: Conflict with two expat shared libraries

Karl Waclawek karl at waclawek.net
Sat Oct 16 23:35:11 CEST 2004


----- Original Message ----- 
From: "Steinar Bang" <sb at dod.no>
Sent: Saturday, October 16, 2004 5:10 PM
> 
> I've added a Feature Request, that aims to avoid this problem in the
> future: 
> http://sourceforge.net/tracker/index.php?func=detail&aid=1048448&group_id=10127&atid=110127
> 
> I managed to get my application working properly again, by using your
> explicit load approach.
> 
> Some details:
> 
> - I created static functions with the same signature as the expat API
>   functions I was using, and then used these functions in my own
>   code, instead of using the "XML_" functions directly.
>   Each of these static functions had a static function pointer
>   variable.  If null, this pointer is resolved against the library
>   named "myapptp_expat".  After resolving the function is called via
>   the function pointer.  The functions are included below
> 
> - I had to make sure that my own expath shared library was linked
>   with the -Bsymbolic flag.  If it wasn't, the functions I were
>   linking explicitly were using functions in the other expat shared
>   library (the functions with the "Xml" prefix, like
>   eg. XmlGetUtf16InternalEncoding() ).
>   Since my build system uses gcc to create the shared lib, I sent the
>   options "-Xlinker -Bsymbolic" when linking the shared lib

Yes, that looks like what I would have done.
Could you not have avoided the special -Bsymbolic flag by naming your function
pointers differently than their Expat names?

Karl




More information about the Expat-discuss mailing list