adamwulf / ClippingBezier

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

Undefined symbols for architecture arm64 #2

Closed moax closed 7 years ago

moax commented 7 years ago

Hi, I also downloaded and implemented your framework into my swift project. I included the PerformanceBezier and the ClippingBezier Frameworks via bridging header.

In the build settings, I added "-ObjC++ -lstdc++" (I also tried with "-ObjC -lstdc++") under OTHER_LDFLAGS. Before doing this, the app was compiled, but when I called the function, it gave a libc++abi.dylib: terminating with uncaught exception of type NSException Error.

With the updated linker flags, it gives:

Undefined symbols for architecture arm64:
  "_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 arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
adamwulf commented 7 years ago

hrm, not sure about this. you may try the -all_load flag as well and see if that fixes it.

moax commented 7 years ago

I managed to resolve the issue now. I did not add the linker flag -lstdc++ in the framework xcodeproject on compiling. After adding it there, the frameworks load correctly and it works now. Thanks for your excellent work!