Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking xerces static library for Mac OS X

I'm trying to link xerces as a static library, but I have some problems...

Undefined symbols for architecture x86_64:
  "_CFRelease", referenced from:
      xercesc_3_1::MacOSUnicodeConverter::upperCase(unsigned short*) in libxerces-c.a(MacOSUnicodeConverter.o)
      xercesc_3_1::MacOSUnicodeConverter::lowerCase(unsigned short*) in libxerces-c.a(MacOSUnicodeConverter.o)
  "_CFStringCreateMutableWithExternalCharactersNoCopy", referenced from:
      xercesc_3_1::MacOSUnicodeConverter::upperCase(unsigned short*) in libxerces-c.a(MacOSUnicodeConverter.o)
      xercesc_3_1::MacOSUnicodeConverter::lowerCase(unsigned short*) in libxerces-c.a(MacOSUnicodeConverter.o)
  "_CFStringLowercase", referenced from:
      xercesc_3_1::MacOSUnicodeConverter::lowerCase(unsigned short*) in libxerces-c.a(MacOSUnicodeConverter.o)
  "_CFStringUppercase", referenced from:
      xercesc_3_1::MacOSUnicodeConverter::upperCase(unsigned short*) in libxerces-c.a(MacOSUnicodeConverter.o)
  "_CreateTextEncoding", referenced from:
      xercesc_3_1::MacOSUnicodeConverter::discoverLCPEncoding() in libxerces-c.a(MacOSUnicodeConverter.o)
      xercesc_3_1::MacOSUnicodeConverter::makeNewXMLTranscoder(unsigned short const*, xercesc_3_1::XMLTransService::Codes&, unsigned long, unsigned int, xercesc_3_1::MemoryManager*) in libxerces-c.a(MacOSUnicodeConverter.o)
   ...

I've tried to run configure with different options, but all attempts were useless.

Has anyone had the same problem?

like image 365
Yurii Rebryk Avatar asked Sep 20 '25 18:09

Yurii Rebryk


1 Answers

I ran into this issue when building xalan. I fixed it by passing -framework CoreServices -framework CoreFoundation -lcurl to the linker.

Line 76 of xalan's Makefile.incl:

XERCES_LIB = -L$(XERCESCROOT)/lib -lxerces-c -framework CoreServices -framework CoreFoundation -lcurl
like image 79
Bruno Jouhier Avatar answered Sep 24 '25 05:09

Bruno Jouhier