为Mac OS X链接xerces静态库

时间:2016-02-02 16:50:44

标签: macos static-libraries osx-elcapitan xerces-c

我正在尝试将xerces链接为静态库,但我遇到了一些问题......

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)
   ...

我尝试使用不同的选项运行 configure ,但所有尝试都没用。

有没有人遇到同样的问题?

1 个答案:

答案 0 :(得分:0)

构建xalan时遇到了这个问题。我通过将-framework CoreServices -framework CoreFoundation -lcurl传递给链接器来修复它。

xalan' Makefile.incl的第76行:

XERCES_LIB = -L$(XERCESCROOT)/lib -lxerces-c -framework CoreServices -framework CoreFoundation -lcurl