# How to create an Objective C Library Wrapper

**URL:** <https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299>\
**Category:** General Usage\
**Tags:** question, interoperability\
**Created:** [September 11, 2025, 5:05pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299 "2025-09-11T17:05:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![skolari93](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skolari93/32/30359_2.png) [@skolari93](https://discourse.julialang.org/u/skolari93)\
**Post date:** [September 11, 2025, 5:05pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299/1 "2025-09-11T17:05:21Z")

</div>

I want to write a wrapper for an Objective C library (Syphon Framework). I am not sure how to proceed and which packages to use.  
I did build the library in my directory for testing. But I am not sure how to proceed, as I think Clang only works properly with C. And it demands to include .Frameworks, which is too big and makes everything fail.  
I am happy for any tips how I could proceed. Thanks!

PS: I rephrased my question from a few days ago, to make it more general.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 11, 2025, 5:57pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299/2 "2025-09-11T17:57:08Z")

</div>

Julia can only directly call C functions, so you will first need to wrap C wrapper functions (written and compiled using Objective C) around the API you want to access, like what Apple did with the [CoreFoundation](https://en.wikipedia.org/wiki/Core_Foundation) library. Once you have a C API, compiled into a shared library, it is straightforward to call from Julia.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 11, 2025, 6:13pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299/3 "2025-09-11T18:13:01Z")

</div>

Shouldn’t you use ObjectiveC.jl?

> [@stevengj](#):
>
> Julia can only directly call C functions, so you will first need to wrap C wrapper functions

While technically true, isn’t that other package not to avoid that or automate?

It works on macOS including version 26 seemingly ([Normalize macOS version by christiangnrd · Pull Request #61 · JuliaInterop/ObjectiveC.jl · GitHub](https://github.com/JuliaInterop/ObjectiveC.jl/pull/61)), tested on macOS; [not iOS, since if you want to support iOS/iPadOS then not possible currently to support…]

I neither think you expect this to work on Windows or Linux…

[Another thing this is a (real-time) _framework_ as in “don’t call us, we call you”. I’m not sure a problem. You call it as a library, and it will work by still calling you? I’m not to worried about the real-time part of it. Likely will just work (and is soft-realtime).

Do you know if anything similar works on Linux or could be cross-platform to all (relevant/desktop) platforms, including macOS? At least if you run into any trouble with (with the package and) Syphon/frameworks.]

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 11, 2025, 7:16pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299/4 "2025-09-11T19:16:22Z")

</div>

> [@Palli](#):
>
> Shouldn’t you use [ObjectiveC.jl](https://juliaregistries.github.io/General/packages/redirect_to_repo/ObjectiveC)?

Oh, right, I forgot about this package. It looks like it works by calling the [Objective-C Runtime library](https://developer.apple.com/documentation/objectivec/objective-c-runtime) directly, which is possible since that low-level API is apparently written in C.

---

<div class="post-metadata">

**Author:** ![skolari93](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skolari93/32/30359_2.png) [@skolari93](https://discourse.julialang.org/u/skolari93)\
**Post date:** [September 11, 2025, 7:32pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299/5 "2025-09-11T19:32:01Z")

</div>

yes i only need macos (as it is a macos only library).

so i am not sure now how one would call compiled objc code. how do i include this in my file?

if you are aware of a simple wrapper package, where i could check how this works, this would be great.  
Metal.jl is a bit big as a first easy example.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 11, 2025, 7:42pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299/6 "2025-09-11T19:42:06Z")

</div>

You can look up dependents for packages e.g. [JuliaHub](https://juliahub.com/ui/Packages/General/ObjectiveC#dependents)

I see only one other (registered) dependent package (plus three indirect, click above in case it may help, to see them) in case it helps MacOSIOReport.jl but I haven’t used ObjectiveC.jl myself (nor do I use a mac).
