• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

stand alone cairo lib for macos

Contributor ,
Dec 17, 2020 Dec 17, 2020

Copy link to clipboard

Copied

Dear AE fellows,

I wrote a plugin for AE for windows which used cairo library.

I simply used the standalone cairo binary for windows which was easily downloaded from thr web. 

Now I'd like to rewrite my plugin for MacOs.

Do you know if there is standalone cairo library for macos?

 

Yaroslav.

 

TOPICS
SDK

Views

696

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Dec 21, 2020 Dec 21, 2020

Hi Yaro

I'm not sure if it will work, but here's the cairo libraries I use (statically compiled). 

lib archive 

Votes

Translate

Translate
Engaged ,
Dec 21, 2020 Dec 21, 2020

Copy link to clipboard

Copied

Hi Yaro

I'm not sure if it will work, but here's the cairo libraries I use (statically compiled). 

lib archive 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 21, 2020 Dec 21, 2020

Copy link to clipboard

Copied

James, thank you so much!

I'll check it out!

Yaroslav.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

You're welcome Yaroslav. Did they work for you?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

Dear James, unfortunately they didn't. Eventually we postponed the developing of the project for MacOs. (We will return to it this summer). But thanks for your help! We will no doubt make it work in the summer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 08, 2025 Jan 08, 2025

Copy link to clipboard

Copied

Hi James, I'm having issues compiling cairo for macos (working in windows, statically). I did try your statically compiled libraries (and other from web), but I'm not sure for settings in xcode. Tried pretty much everything I could think of. First of all, in xcode, mach-O type should be Bundle or  Static library? If I bundle it, it reads dylib from my drive (but then user cannot run this). If I compile it "Static Library" I get error in AE couldnt find entry point. (Also I signed/notarised/stepled my plugin). Do I need to type a certian directive in header file (like for windows CAIRO_WIN32_STATIC_BUILD). Any help is much appreciated!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 10, 2025 Jan 10, 2025

Copy link to clipboard

Copied

Hi

 

It's been a while but I compiled it using command line so I'm not sure on the Xcode settings. Also which version of cairo are you trying to build? The later releases have much more dependencies which made it so difficult to compile that I gave up and outsourced the job. 

For mac, there shouldn't be any special defines like the windows CAIRO_WIN32_STATIC_BUILD.

 

What happens if you use the libs I linked?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 10, 2025 Jan 10, 2025

Copy link to clipboard

Copied

Let me try to explain my situation as briefly as I can. I made a plugin which uses cairo static library - libcairo.a. I compiled it on xcode, and it was working fine on my mac. The issue came when it went for sale, few people who use mac contacted me all with error in AE "cannot find entry point". I found out that the plugin only works on my mac, because for some reason, even though it's static library, it's still calling libcairo.2.dylib (dynamic one) from /opt/local/lib where static and dynamic libraries are, and of course users don't have these on their disk so they got the error. I've tried pretty much everything I could in xcode, so it doesn't call dynamic lib, but it always does for some reason (I also confirm this when I inspect plugin binary with otool -L). 

To recap: cairo works but only when it has dynamic libraries in folder. I either need to find out how to pack dynamic libs into plugin bundle and then tell xcode to call these from it's own bundle (which I didn't figure out how to do), or that static library just works as it should without dynamic libs (preffered). 

 

p.s. your static libraries give me 100+ errors, basically something with headers I think (cannot exactly remember now)
Thank you very much for you reply James.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 13, 2025 Jan 13, 2025

Copy link to clipboard

Copied

It sounds like your compiled cairo isn't fully static or has some dynamic dependencies. If the users need libcairo.2.dylib to run it, could you bundle that in the Frameworks folder of your .plugin bundle and have it reference that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 14, 2025 Jan 14, 2025

Copy link to clipboard

Copied

Well, that was my thought, but the issue is, I'm very unexperienced with xcode (and linking libraries in general honestly), so I'm not really sure how to link that (and believe me I tried...) Some sugesstion on how to do that would be much appreciated. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

So, I finally made it work, after a lot of pain 😄 

First, when getting cairo library (for example macports), it should be for both architecture's and static, so for example cairo for macports would be 

 

 

sudo port cairo +universal +static

 

 

but dependencies should also be static. And see attached image for which dependencies you need:

mirza36163514e0ud_0-1737031055850.png

Some libraries I couldn't get static (like libpixman), and then I had to get tar.gz file, and use make to compile static library. (This was a bit more complicated, I used claude for help). Then, everything else in xcode is pretty straightforward, in other linker flags I left empty, library search path can be working directory (when you add libs to xcode, make sure to copy to working dir), and then you can just use macro: $(PROJECT_DIR) in Library Search Paths. in header search paths you add /opt/local/include and in build phases all libs have to link with binary (although this is done automatically if you drag them to xcode).

 

If someone needs these static libs, contact me at info@mirzakadic.com and I will send them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 19, 2025 Jan 19, 2025

Copy link to clipboard

Copied

LATEST

Nice work! The newer versions of cairo have a lot more dependencies as seen in your screenshot. The older versions just required libpng and libpixman.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines