adamwulf / ClippingBezier

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
http://getlooseleaf.com/opensource/
MIT License
254 stars 34 forks source link

Undefined symbols for x86_64 architecture #1

Closed cyprusad closed 7 years ago

cyprusad commented 7 years ago

Hello! I tried downloading and linking this library to a Swift 3 app today; I was attempting to test on simulator and kept running into

  "_bezierPointAtT", referenced from:
      ___62-[UIBezierPath(Ahmed) bezierPathByFlatteningPathAndImmutable:]_block_invoke in ClippingBezier(UIBezierPath+Ahmed.o)
  "_distance", referenced from:
      -[UIBezierPath(Trimming) bezierPathByTrimmingToLength:withMaximumError:] in ClippingBezier(UIBezierPath+Trimming.o)
      -[UIBezierPath(Trimming) bezierPathByTrimmingFromLength:withMaximumError:] in ClippingBezier(UIBezierPath+Trimming.o)
      ___32-[UIBezierPath(Trimming) length]_block_invoke in ClippingBezier(UIBezierPath+Trimming.o)
      ___74-[UIBezierPath(Clipping) findIntersectionsWithClosedPath:andBeginsInside:]_block_invoke_2 in ClippingBezier(UIBezierPath+Clipping.o)
      ___56-[UIBezierPath(Clipping) tangentRoundingNearStartOrEnd:]_block_invoke in ClippingBezier(UIBezierPath+Clipping.o)
      ___56-[UIBezierPath(Clipping) tangentRoundingNearStartOrEnd:]_block_invoke.361 in ClippingBezier(UIBezierPath+Clipping.o)
      _tValOfPointOnLine in ClippingBezier(UIBezierPath+GeometryExtras.o)
      ...
  "_subdivideBezierAtT", referenced from:
      ___62-[UIBezierPath(Ahmed) bezierPathByFlatteningPathAndImmutable:]_block_invoke in ClippingBezier(UIBezierPath+Ahmed.o)
      ___71-[UIBezierPath(Ahmed) bezierPathByTrimmingElement:fromTValue:toTValue:]_block_invoke in ClippingBezier(UIBezierPath+Ahmed.o)
      ___65-[UIBezierPath(Ahmed) bezierPathByTrimmingFromElement:andTValue:]_block_invoke in ClippingBezier(UIBezierPath+Ahmed.o)
      ___63-[UIBezierPath(Ahmed) bezierPathByTrimmingToElement:andTValue:]_block_invoke in ClippingBezier(UIBezierPath+Ahmed.o)
  "_lengthOfBezier", referenced from:
      -[UIBezierPath(Trimming) bezierPathByTrimmingToLength:withMaximumError:] in ClippingBezier(UIBezierPath+Trimming.o)
      -[UIBezierPath(Trimming) bezierPathByTrimmingFromLength:withMaximumError:] in ClippingBezier(UIBezierPath+Trimming.o)
      ___32-[UIBezierPath(Trimming) length]_block_invoke in ClippingBezier(UIBezierPath+Trimming.o)
  "_subdivideBezierAtLength", referenced from:
      -[UIBezierPath(Trimming) bezierPathByTrimmingToLength:withMaximumError:] in ClippingBezier(UIBezierPath+Trimming.o)
      -[UIBezierPath(Trimming) bezierPathByTrimmingFromLength:withMaximumError:] in ClippingBezier(UIBezierPath+Trimming.o)
  "_distanceOfPointToLine", referenced from:
      ___62-[UIBezierPath(Ahmed) bezierPathByFlatteningPathAndImmutable:]_block_invoke in ClippingBezier(UIBezierPath+Ahmed.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

while trying to compile my project with the framework added

I tried the usual suspects of adding i386 and x86_64 to the Valid architectures for both ClippingBezier as well as PerformanceBezier frameworks respectively, and using the those products in my project, but no luck.

I don't know if this is an issue with the framework per so, or if I am just missing something altogether. Would appreciate your insight/experience on these type of issues @adamwulf ✌️

adamwulf commented 7 years ago

In your Build Settings, make sure to add -ObjC -lstdc++ to the Other Linker Flags. That should do the trick :)

cyprusad commented 7 years ago

Turns out, I also needed to include the PerformanceBezier.framework in addition to the ClippingBezier.framework in my project with the proper linker flags set, and then it worked. Thanks for weighing in!