使用Regex LiteKnit在mapview上绘制路线时出错

时间:2012-09-02 04:27:40

标签: regex ios4

在我的一个iphone项目中,我使用RegexLiteKit在mapview中绘制路径。正在编译以下故障时,

Undefined symbols for architecture i386:
  "_uregex_start", referenced from:
      _rkl_performRegexOp in RegexKitLite.o
      _rkl_search in RegexKitLite.o
      _rkl_findRanges in RegexKitLite.o
  "_uregex_end", referenced from:
      _rkl_performRegexOp in RegexKitLite.o
      _rkl_search in RegexKitLite.o
      _rkl_findRanges in RegexKitLite.o
  "_uregex_setText", referenced from:
      _rkl_clearCacheSlotSetTo in RegexKitLite.o
      _rkl_setCacheSlotToString in RegexKitLite.o
  "_uregex_find", referenced from:
      _rkl_search in RegexKitLite.o
  "_uregex_findNext", referenced from:
      _rkl_search in RegexKitLite.o
      _rkl_replaceAll in RegexKitLite.o
  "_u_errorName", referenced from:
      _rkl_NSExceptionForRegex in RegexKitLite.o
      _rkl_userInfoDictionary in RegexKitLite.o
  "_u_strlen", referenced from:
      _rkl_userInfoDictionary in RegexKitLite.o
  "_uregex_reset", referenced from:
      _rkl_replaceAll in RegexKitLite.o
  "_uregex_appendReplacement", referenced from:
      _rkl_replaceAll in RegexKitLite.o
  "_uregex_appendTail", referenced from:
      _rkl_replaceAll in RegexKitLite.o
  "_uregex_open", referenced from:
      _rkl_getCachedRegex in RegexKitLite.o
  "_uregex_groupCount", referenced from:
      _rkl_getCachedRegex in RegexKitLite.o
  "_uregex_close", referenced from:
      _rkl_clearCacheSlotRegex in RegexKitLite.o

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有没有办法让RegexLiteKit工作?请帮忙..

6 个答案:

答案 0 :(得分:18)

  • 转到目标构建设置
  • 搜索linker flags
  • other linker flags附近双击并添加-licucore

完成

答案 1 :(得分:14)

将libicucore框架添加到您的项目中解决此问题并参考此链接http://www.mobisoftinfotech.com/blog/iphone/iphone-regular-expression-tutorial-regexkitlite-framework/

答案 2 :(得分:10)

我通过在我的项目中添加libicucore框架来解决这个问题。添加libicucore框架工作的方法构建设置 - >链接 - >其他链接器标志 - > -licucore

答案 3 :(得分:9)

您需要在下面设置链接器标志才能执行相同操作。 转到构建设置 - >链接 - >其他链接器标志 - >的 -licucore

不要忘记在 licucore 上面添加 -

答案 4 :(得分:1)

如果您没有将arc用于项目,请为-fno-objc-arc添加编译器标记RegexKitLite.m

接下来,您必须通过以下方式添加其他链接器标志:

构建设置>链接> 其他链接标记

添加:

-licucore
-ObjC
-lc++

谢谢,

答案 5 :(得分:1)

对于iOS 9.2和Xcode 7,我解决了以下问题

  1. 点击您的项目
  2. 点击目标
  3. 点击“构建阶段”标签
  4. 双击RegexKitLie.m
  5. 在opend框中输入-fno-objc-arc
  6. 完成并享受。