Re: [xml] Mac OS 10.9 issue




On 2013-10-24, at 2:18 AM, Frank Gross <fg 4js com> wrote:

Hi,

 I've build an executable using libxml2.8.0 via a dlopen on a Mac OS 10.8 system. But when I install my 
binaries on a mac OS 10.9 system, I get following error : "Incompatible library version: xml.dylib requires 
version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0.”

This is due to building your executable against your own build of libxml2 on OS X 10.8, and then running it 
against the system version of libxml2 on OS X 10.9. You shouldn’t see this problem if you build against the 
system version of libxml2 on OS X 10.8 and then run on OS X 10.9.

Has anyone got the same kind of error ? Or does anymore know, why on mac, starting an executable has 
apparently a side effect of loading libxml, even if not xml is used in the code ?

Mach-O binaries contain a list of dynamic libraries that you were linked against at build time. These 
libraries are loaded during launch to check for version and architecture compatibility between what the 
binary expects and the libraries that are actually available. You can see the list of linked libraries using 
`otool -L /path/to/binary`. If you’re intending to lazily load libxml2 using dlopen then there’s no need to 
explicitly link against it at build time (e.g., no need to pass -lxml2 to ld).

- Mark



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]