KarthikRIyer / swiftplot

Swift library for Data Visualization :bar_chart:
Apache License 2.0
398 stars 36 forks source link

compiling error with "Freetype" library in Xcode project #133

Open annapurnarelan20 opened 2 years ago

annapurnarelan20 commented 2 years ago

Hi, After doing all the steps for installation Swiftplot in my project, I installed freetype lib with brew and still getting the error as shown in the screenshot.

Plese help ! as I am stuck ...

Screenshot 2022-01-07 at 11 26 21 PM
KarthikRIyer commented 2 years ago

Hi

The error says that you're trying to build for iOS, but the freetype dylib is built for macOS. Freetype is used by the AGGRenderer. This does not have support for iOS right now. For iOS you can use the QuartzRenderer.

To build swiftplot itself for iOS, you need to make a change to the Package.swift file as mentioned here: https://github.com/KarthikRIyer/swiftplot/blob/7cface0237635b9d48142969e9884c0058036624/Package.swift#L49

But if you're trying to add swiftplot as a dependency, I'm not sure how that's possible. Maybe @karwa knows a way?

You could try to add it as a local dependency and make the change as shown here (I haven't tried this): https://developer.apple.com/documentation/swift_packages/editing_a_package_dependency_as_a_local_package

annapurnarelan20 commented 2 years ago

yes thanks @KarthikRIyer ,was not able to edit the Package.swift as added the libaray as dependency , have to do that as you suggested will check this out how to add it as local dependency then will be able to do that.

Thanks for the Quick Support.