# Example of Clang.jl wrapping C interface using GMP mpq\_t (also arrays of mpq\_t)

**URL:** <https://discourse.julialang.org/t/example-of-clang-jl-wrapping-c-interface-using-gmp-mpq-t-also-arrays-of-mpq-t/112864>\
**Category:** General Usage\
**Tags:** question, c, rational\
**Created:** [April 12, 2024, 9:12am UTC](https://discourse.julialang.org/t/example-of-clang-jl-wrapping-c-interface-using-gmp-mpq-t-also-arrays-of-mpq-t/112864 "2024-04-12T09:12:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonT](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@JonT](https://discourse.julialang.org/u/JonT)\
**Post date:** [April 12, 2024, 9:12am UTC](https://discourse.julialang.org/t/example-of-clang-jl-wrapping-c-interface-using-gmp-mpq-t-also-arrays-of-mpq-t/112864/1 "2024-04-12T09:12:22Z")

</div>

I’m stumbling through wrapping an interface to a C library using Clang.jl.  
Im hoping someone can. give me some hints about the best way to wrap methods passing and returning GMP mpq\_t types, or arrays of them.

I found an old thread which discusses manually using ccall with mpq\_t ([Finalizer only works with mutable structs?](https://discourse.julialang.org/t/finalizer-only-works-with-mutable-structs/28777/)) but I was hoping given the age, and the obvious importance of mpq\_t that someone would have an example I can use as a template.
