# \#clang

**URL:** https://discourse.julialang.org/tag/clang/878.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Clang.jl on a Header with Function Overloading](https://discourse.julialang.org/t/clang-jl-on-a-header-with-function-overloading/128083)

<div class="topic-metadata">

**Author:** [@luke-kiernan](https://discourse.julialang.org/u/luke-kiernan)\
**Replies:** 0\
**Last updated:** [April 15, 2025, 2:57am UTC](https://discourse.julialang.org/t/clang-jl-on-a-header-with-function-overloading/128083 "2025-04-15T02:57:53Z")

</div>

Is it possible to use Clang.jl to parse a header that uses the overloadable attribute? When I try, it only parses the first function with each name. Here’s my build setup: you’ll have to be on an Apple Silicon Mac to run…

---

## [Guidelines for wrapping a simple C library in Julia](https://discourse.julialang.org/t/guidelines-for-wrapping-a-simple-c-library-in-julia/112335)

<div class="topic-metadata">

**Author:** [@pjssilva](https://discourse.julialang.org/u/pjssilva)\
**Replies:** 6\
**Last updated:** [March 31, 2024, 11:57pm UTC](https://discourse.julialang.org/t/guidelines-for-wrapping-a-simple-c-library-in-julia/112335 "2024-03-31T23:57:53Z")

</div>

I am scratching my own itch here and decided to write a wrapper to a small C library I wrote to solve the problem of projecting a point onto the intersection of a box and a hyperplane. Is there a good “best practices” d…

---

## [How to handle light wrapper packages generated by Clang.jl?](https://discourse.julialang.org/t/how-to-handle-light-wrapper-packages-generated-by-clang-jl/108114)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [December 27, 2023, 9:51pm UTC](https://discourse.julialang.org/t/how-to-handle-light-wrapper-packages-generated-by-clang-jl/108114 "2023-12-27T21:51:49Z")

</div>

Using Clang.jl, Julia bindings can made quite easily using Clang.jl. While this is almost automatic, it does require some manual fine tuning to work. Below are some examples of such packages. In the case of LibTIFF.jl a…

---

## [Clang vs CBindingGen](https://discourse.julialang.org/t/clang-vs-cbindinggen/56693)

<div class="topic-metadata">

**Author:** [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Replies:** 29\
**Last updated:** [December 4, 2022, 7:43am UTC](https://discourse.julialang.org/t/clang-vs-cbindinggen/56693 "2022-12-04T07:43:50Z")

</div>

I’m thinking about generating a wrapper for a pure C library (raylib). So far I have found two options for doing that (semi-) automatically: Clang and CBindingGen. Clang seems to be the default option, but while documen…

---

## [Using CLang version 14](https://discourse.julialang.org/t/using-clang-version-14/89321)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 0\
**Last updated:** [October 26, 2022, 7:11pm UTC](https://discourse.julialang.org/t/using-clang-version-14/89321 "2022-10-26T19:11:25Z")

</div>

I would like to use CLang version 14 to parse some C++ files. The C++ files I would like to parse are using the “module” feature added in C++20 and it doesn’t appear that version 13 understands the module keyword. I bel…

---

## [Type hierarchy within Clang.jl](https://discourse.julialang.org/t/type-hierarchy-within-clang-jl/85451)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 1\
**Last updated:** [August 8, 2022, 12:33pm UTC](https://discourse.julialang.org/t/type-hierarchy-within-clang-jl/85451 "2022-08-08T12:33:03Z")

</div>

I’m using Clang.jl to automatically generate julia wrappers over C structs, lets call them MyType1, MyType2, etc: struct MyType1 # generated by Clang.jl end struct MyType2 # generated by Clang.jl end However, t…

---

## [Mutually-circular type declarations for Clang.jl](https://discourse.julialang.org/t/mutually-circular-type-declarations-for-clang-jl/29411)

<div class="topic-metadata">

**Author:** [@steveaccount](https://discourse.julialang.org/u/steveaccount)\
**Replies:** 0\
**Last updated:** [October 2, 2019, 2:37pm UTC](https://discourse.julialang.org/t/mutually-circular-type-declarations-for-clang-jl/29411 "2019-10-02T14:37:53Z")

</div>

Where is the latest info about mutually-circular type declarations (also called ‘mutually recursive type declarations’, also for structs). Open issue in Julia since 2011. Latest info? Maybe “recursive field types, the e…

---

## [Clang.jl doesn't work for netmap (problem #ifdefs)](https://discourse.julialang.org/t/clang-jl-doesnt-work-for-netmap-problem-ifdefs/28596)

<div class="topic-metadata">

**Author:** [@steveaccount](https://discourse.julialang.org/u/steveaccount)\
**Replies:** 2\
**Last updated:** [August 7, 2022, 8:12am UTC](https://discourse.julialang.org/t/clang-jl-doesnt-work-for-netmap-problem-ifdefs/28596 "2022-08-07T08:12:04Z")

</div>

There is a possible bug/problem with Clang.jl. I am an assistant prof working on an implementation of netmap in Julia (fast networks by bypassing the kernel for IO). Here is the example: This works only if I remove an…

---

## [How do I obtain \`sizeof(struct sigaction)\`? Clang.jl?](https://discourse.julialang.org/t/how-do-i-obtain-sizeof-struct-sigaction-clang-jl/84344)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 4\
**Last updated:** [July 18, 2022, 8:33am UTC](https://discourse.julialang.org/t/how-do-i-obtain-sizeof-struct-sigaction-clang-jl/84344 "2022-07-18T08:33:42Z")

</div>

I would like to figure out the value printed by this C program in Julia. #include \<signal.h\> #include \<stdio.h\> int main() { printf("%ld", sizeof(struct sigaction)); return 0; } On my system, this print…

---

## [Wrapping a C library | Where to start?](https://discourse.julialang.org/t/wrapping-a-c-library-where-to-start/71658)

<div class="topic-metadata">

**Author:** [@MLackner](https://discourse.julialang.org/u/MLackner)\
**Replies:** 6\
**Last updated:** [March 15, 2022, 4:46pm UTC](https://discourse.julialang.org/t/wrapping-a-c-library-where-to-start/71658 "2022-03-15T16:46:41Z")

</div>

Hi! I want to use a few functions of a dll file from Julia and I want to wrap them in a package. The dlls I want to use are for talking to some motion controllers (The dlls in question can be found on thorlabs.com. Ther…

---

## [Can I compile native C programs on Julia CI?](https://discourse.julialang.org/t/can-i-compile-native-c-programs-on-julia-ci/75340)

<div class="topic-metadata">

**Author:** [@melonedo](https://discourse.julialang.org/u/melonedo)\
**Replies:** 2\
**Last updated:** [January 28, 2022, 5:27am UTC](https://discourse.julialang.org/t/can-i-compile-native-c-programs-on-julia-ci/75340 "2022-01-28T05:27:28Z")

</div>

When I am developing Clang.jl, a package which bridges C and Julia, I find it necessary that I test the generated wrapper against C libraries. Apart from testing on existing libraries shipped with jll packages, one way i…

---

## [Unsuppress compiler error messages in Clang.jl](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934)

<div class="topic-metadata">

**Author:** [@elkawee](https://discourse.julialang.org/u/elkawee)\
**Replies:** 3\
**Last updated:** [July 2, 2021, 5:27pm UTC](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934 "2021-07-02T17:27:00Z")

</div>

Hi :slight\_smile: I’m pretty sure i’m the 100th guy who asks this, but i can’t find anything. I ripped out the relevant parts to be able to call trans\_unit.jl/parse\_header(..) directly, and when i do, the usual clang …

---

## [Doubt about using Clang.jl](https://discourse.julialang.org/t/doubt-about-using-clang-jl/36599)

<div class="topic-metadata">

**Author:** [@amCap1712](https://discourse.julialang.org/u/amCap1712)\
**Replies:** 15\
**Last updated:** [January 5, 2021, 7:18am UTC](https://discourse.julialang.org/t/doubt-about-using-clang-jl/36599 "2021-01-05T07:18:04Z")

</div>

I am trying to use to Clang.jl to parse header files for GNUAstro. GNUAstro has a dependency called wcslib. When I try to run the generated .jl file, I get the error that wcsperm is not defined. That makes sense because w…

---

## [Clang.jl wrapper generation warnings/missing parts](https://discourse.julialang.org/t/clang-jl-wrapper-generation-warnings-missing-parts/34093)

<div class="topic-metadata">

**Author:** [@rayegun](https://discourse.julialang.org/u/rayegun)\
**Replies:** 9\
**Last updated:** [January 2, 2021, 10:29pm UTC](https://discourse.julialang.org/t/clang-jl-wrapper-generation-warnings-missing-parts/34093 "2021-01-02T22:29:25Z")

</div>

I’m trying to wrap this this GraphBLAS.h file using Clang.jl (There is already a wrapper package, but I want to try generating it automatically). I used this code: const z = "/usr/lib/clang/9.0.0/include" const y = "/ho…

---

## [Wrapping a recursive struct with Clang.jl](https://discourse.julialang.org/t/wrapping-a-recursive-struct-with-clang-jl/40680)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 1\
**Last updated:** [June 3, 2020, 3:38pm UTC](https://discourse.julialang.org/t/wrapping-a-recursive-struct-with-clang-jl/40680 "2020-06-03T15:38:59Z")

</div>

I am trying to wrap a C library containing several recursive structs like this: struct B; typedef struct A { int foo; struct B \*b; } A; typedef struct B { int faa; A \*a; } B; produces wrapper like this # Aut…

---

## [Clang.jl ignoring #define starting with underscore](https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 2\
**Last updated:** [April 30, 2020, 7:04am UTC](https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426 "2020-04-30T07:04:00Z")

</div>

I have some header files which I’d like to wrap with Clang.jl. Why does it ignore definitions starting with underscore such as: #define \_VAR (1) If I remove the underscore, it works fine: #define VAR (1) const VAR =…

---

## [Include debug symbols in sysimage from PackageCompiler.jl?](https://discourse.julialang.org/t/include-debug-symbols-in-sysimage-from-packagecompiler-jl/38034)

<div class="topic-metadata">

**Author:** [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Replies:** 2\
**Last updated:** [April 26, 2020, 6:25pm UTC](https://discourse.julialang.org/t/include-debug-symbols-in-sysimage-from-packagecompiler-jl/38034 "2020-04-26T18:25:11Z")

</div>

I’m attempting to use PackageCompiler.jl to produce a .so containing Julia functions that can be called directly from C (after some julia initialization in the C code), as suggested by @kristoffer.carlsson in this githu…

---

## [Clang.jl generates lower case structs](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 2\
**Last updated:** [June 3, 2019, 11:14am UTC](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881 "2019-06-03T11:14:45Z")

</div>

I am trying to make a wrapper for a C-library and everything seems to work nicely except that Clang.jl emits the struct names in lower case. I guess I am missing something in the the generate.jl script?

---

## [Wrapping typedef enum with Clang.jl](https://discourse.julialang.org/t/wrapping-typedef-enum-with-clang-jl/17425)

<div class="topic-metadata">

**Author:** [@samuelpowell](https://discourse.julialang.org/u/samuelpowell)\
**Replies:** 11\
**Last updated:** [November 13, 2018, 8:17am UTC](https://discourse.julialang.org/t/wrapping-typedef-enum-with-clang-jl/17425 "2018-11-13T08:17:52Z")

</div>

If I try to wrap the following header: typedef enum \_foo { BAR, BAZ } foo; using the following Clang.jl script: using Clang.wrap\_c const context = wrap\_c.init( headers = \[joinpath(@\_\_DIR\_\_, "header.h")\], …

---

## [Clang.jl large library](https://discourse.julialang.org/t/clang-jl-large-library/8483)

<div class="topic-metadata">

**Author:** [@mopg](https://discourse.julialang.org/u/mopg)\
**Replies:** 8\
**Last updated:** [January 22, 2018, 6:42pm UTC](https://discourse.julialang.org/t/clang-jl-large-library/8483 "2018-01-22T18:42:14Z")

</div>

I am trying to link Julia to a large C library. I was thinking that that wouldn’t be an issue given that everyone always says it is straightforward to link C to Julia with minimal performance loss. My problem is that I h…

---

## [Issue geting started with Clang.jl](https://discourse.julialang.org/t/issue-geting-started-with-clang-jl/2302)

<div class="topic-metadata">

**Author:** [@americast](https://discourse.julialang.org/u/americast)\
**Replies:** 3\
**Last updated:** [February 26, 2017, 4:24am UTC](https://discourse.julialang.org/t/issue-geting-started-with-clang-jl/2302 "2017-02-26T04:24:44Z")

</div>

Hi, I was trying to follow the example given in http://nbviewer.jupyter.org/github/ihnorton/Clang.jl/blob/master/examples/parsing\_c\_with\_clangjl/notebook.ipynb to get an idea of the working of Clang.jl. But I got the fo…
