# Unable to link system library dbus-1 on generic linux compile

**URL:** <https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631>\
**Category:** Help\
**Tags:** build-system\
**Created:** [July 10, 2026, 1:46pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631 "2026-07-10T13:46:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlcoal](https://ziggit.dev/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@charlcoal](https://ziggit.dev/u/charlcoal)\
**Post date:** [July 10, 2026, 1:46pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631/1 "2026-07-10T13:46:59Z")

</div>

I am adding [native file dialog extended](https://github.com/allyourcodebase/nativefiledialog-extended) as a dependency to my project, and I am using portal instead of gtk to avoid X11 conflicts with [glfw.zig](https://github.com/tiawl/glfw.zig). When compiling to x86\_64-linux (not native), I get: `error: error: unable to find dynamic system library 'dbus-1' using strategy 'paths_first'. searched paths: none`. I found the “searched paths: none” to be particularly odd, and I’ve verified that I have libdbus-1-dev on my machine (as well as libdbus-1-3).

---

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [July 10, 2026, 1:58pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631/2 "2026-07-10T13:58:37Z")

</div>

I am not completely sure about how `--search-prefix` is meant to be used, but for me it seemed to work to use something like (to add search paths):

```zig
--search-prefix /usr

```

Edit: I don’t know about dbus and what to do for it specifically.

---

<div class="post-metadata">

**Author:** ![charlcoal](https://ziggit.dev/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@charlcoal](https://ziggit.dev/u/charlcoal)\
**Post date:** [July 10, 2026, 2:22pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631/3 "2026-07-10T14:22:35Z")

</div>

On further inspection it looks like the libdbus-1-dev package places the shared object in `usr/lib/x86_64-linux-gnu` instead of just `usr/lib`. `--search-prefix usr/` only searches for objects directly in `usr/lib`, and other search prefixes don’t work as far as I can tell.

---

<div class="post-metadata">

**Author:** ![pasta](https://ziggit.dev/user_avatar/ziggit.dev/pasta/32/6273_2.png) [@pasta](https://ziggit.dev/u/pasta)\
**Post date:** [July 10, 2026, 3:25pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631/4 "2026-07-10T15:25:35Z")

</div>

I encountered the same issue, solved [here](https://codeberg.org/mdiluz/flyt/src/branch/main/build.zig#L63).

```zig
// Get the dbus include directories, for some reason not picked up by linkSystemLibrary like with libsystemd
const dbus_include_paths = std.mem.trim(u8, b.run(&.{ "pkg-config", "--cflags-only-I", "dbus-1" }), " \n");
    var iter = std.mem.splitScalar(u8, dbus_include_paths, ' ');
    while (iter.next()) |path| {
        dbus_translate_c.addSystemIncludePath(.{ .cwd_relative = path[2..path.len] });
    }

```

Not ideal though, perhaps another solution is available.

---

<div class="post-metadata">

**Author:** ![charlcoal](https://ziggit.dev/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@charlcoal](https://ziggit.dev/u/charlcoal)\
**Post date:** [July 10, 2026, 5:08pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631/5 "2026-07-10T17:08:54Z")

</div>

Adding this didn’t seem to fix my issue. I do also get: `warning: add '/usr/include/dbus-1.0' to header searchlist '-isystem' conflicts with '-I'`.

---

<div class="post-metadata">

**Author:** ![charlcoal](https://ziggit.dev/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@charlcoal](https://ziggit.dev/u/charlcoal)\
**Post date:** [July 10, 2026, 5:12pm UTC](https://ziggit.dev/t/unable-to-link-system-library-dbus-1-on-generic-linux-compile/16631/6 "2026-07-10T17:12:35Z")

</div>

One thing to note is that the dependency I forked to add this change to is from zig 0.14.0 and uses `addCSourceFile` and `addCMacro`, so I used `addSystemIncludePath` on the root module instead of c\_translate.
