swiftplot icon indicating copy to clipboard operation
swiftplot copied to clipboard

compiling error with "Freetype" library in Xcode project

Open annapurnarelan20 opened this issue 3 years ago • 2 comments

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

annapurnarelan20 avatar Jan 07 '22 18:01 annapurnarelan20

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

KarthikRIyer avatar Jan 07 '22 18:01 KarthikRIyer

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.

annapurnarelan20 avatar Jan 09 '22 06:01 annapurnarelan20