Issue with compilation

Your question

I’m trying to compile Stalwart but at the end of compilation I got this message, it was working before:

= note: some arguments are omitted. use --verbose to show all linker arguments
= note: rust-lld: error: unable to find library -lfdb_c
collect2: error: ld returned 1 exit status

error: could not compile stalwart (bin “stalwart”) due to 1 previous error

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

The error unable to find library -lfdb_c means the linker is looking for the FoundationDB C client library, which must be installed on your system as a prerequisite when building with the foundationdb feature.

What to do: Download and install the FoundationDB client library from github.com/apple/foundationdb/releases before running cargo build. The library must be present on your system for the linker to succeed.

If you are not intentionally using FoundationDB as your backend, make sure you are not accidentally including the foundationdb feature flag in your cargo build command. For example, to build with RocksDB instead:

cargo build --release -p stalwart --no-default-features --features "rocks redis"

See the full list of available feature flags in the Compiling Stalwart docs.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong. If you found it useful, mention @helpbot in any reply to ask follow-up questions and the bot will respond again.

That linker error means the build is going through the foundationdb feature, and libfdb_c isn’t on the system. The FoundationDB Cargo feature pulls in foundationdb with embedded-fdb-include and fdb-7_4, which links against the FoundationDB client library at link time; it has to be installed before you build.

If you actually use FoundationDB as the backend: install the matching foundationdb-clients package (the .deb is at Releases · apple/foundationdb · GitHub). If you don’t use FoundationDB, drop --features foundationdb (or set --no-default-features plus the features you want) and the link step won’t ask for libfdb_c.