Yurii Rebryk
Yurii Rebryk

Reputation: 41

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?

Upvotes: 4

Views: 918

Answers (1)

Bruno Jouhier
Bruno Jouhier

Reputation: 1013

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

Upvotes: 4

Related Questions