# Unsuppress compiler error messages in Clang.jl

**URL:** <https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934>\
**Category:** General Usage\
**Tags:** c, clang\
**Created:** [July 2, 2021, 12:34pm UTC](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934 "2021-07-02T12:34:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elkawee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elkawee/32/26619_2.png) [@elkawee](https://discourse.julialang.org/u/elkawee)\
**Post date:** [July 2, 2021, 12:34pm UTC](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934/1 "2021-07-02T12:34:53Z")

</div>

Hi 🙂  
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 error messages are printed to stderr just like calling the compiler conventionally would.

Example:

> /home/elkawee/src\_deb/dbus-1.12.20/cmake/…/dbus/dbus-types.h:31:10: fatal error: ‘dbus/dbus-arch-deps.h’ file not found

But when using the generator as instructed [on its github page](https://github.com/JuliaInterop/Clang.jl)  
These messages are somehow suppressed.

Example:

> Warning: failed to parse /home/elkawee/src\_deb/dbus-1.12.20/dbus/dbus-address.h, skip…

Question:  
Where and how does the Generator suppress those, and how do i get at them?

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [July 2, 2021, 3:48pm UTC](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934/2 "2021-07-02T15:48:19Z")

</div>

Probably because the default flags used in `context.jl/parse_header(..)` and `trans_unit.jl/parse_header(..)` are different.

> /home/elkawee/src\_deb/dbus-1.12.20/cmake/…/dbus/dbus-types.h:31:10: fatal error: ‘dbus/dbus-arch-deps.h’ file not found

I’m sure this error is due to the `include_dir` is not passed correctly to `args`.

> Warning: failed to parse /home/elkawee/src\_deb/dbus-1.12.20/dbus/dbus-address.h, skip…

It looks like you didn’t pass those compiler flags used when building the `dbus` binaries correctly.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [July 2, 2021, 3:55pm UTC](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934/3 "2021-07-02T15:55:51Z")

</div>

There is a BB artifact for `Dbus`, you could give it a try by running:

```julia
pkg> add Dbus_jll

julia> using Dbus_jll

julia> include_dir = joinpath(Dbus_jll.artifact_dir, "include") |> normpath

```

and follow the example in Clang.jl’s README.

`Dubs_jll` only works for Linux, so if you’re not working on Linux, you need to use the new cross-platform API:

```julia
julia> using Clang.Generators

julia> using Clang.JLLEnvs

julia> target = "x86_64-linux-gnu"
"x86_64-linux-gnu"

julia> include_dir = JLLEnvs.get_pkg_include_dir(Dbus_jll, target)

julia> args = get_default_args(target)

```

---

<div class="post-metadata">

**Author:** ![elkawee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elkawee/32/26619_2.png) [@elkawee](https://discourse.julialang.org/u/elkawee)\
**Post date:** [July 2, 2021, 5:27pm UTC](https://discourse.julialang.org/t/unsuppress-compiler-error-messages-in-clang-jl/63934/4 "2021-07-02T17:27:00Z")

</div>

Thank you.  
I am a complete idiot.

There was no suppression of error messages, i passed `args` as `Vector{AbstractString}` instead of `Vector{String}`

… explains why you would not tell me how to turn it off.
