# Build foundationdb client statically into another app

**URL:** <https://forums.foundationdb.org/t/build-foundationdb-client-statically-into-another-app/3809>\
**Category:** Using FoundationDB\
**Tags:** bindings\
**Created:** [February 15, 2023, 1:57pm UTC](https://forums.foundationdb.org/t/build-foundationdb-client-statically-into-another-app/3809 "2023-02-15T13:57:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmthuc](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/dmthuc/32/1522_2.png) [@dmthuc](https://forums.foundationdb.org/u/dmthuc)\
**Post date:** [February 15, 2023, 1:57pm UTC](https://forums.foundationdb.org/t/build-foundationdb-client-statically-into-another-app/3809/1 "2023-02-15T13:57:40Z")

</div>

We have an application that use FoundationDB as backend, we would like to build foundationdb client statically into our app. Do you have any experience or example to do it. Anyway, I have go ahead and try. At the moment I stuck at this linker error.

```auto
ld.lld: error: undefined symbol: Void wait<Void>(Future<Void> const&)
>>> referenced by ThreadHelper.actor.h:43 (/data01/contrib/foundationdb/flow/include/flow/ThreadHelper.actor.h:43)
>>> fdb_c.cpp.o:(void onMainThreadVoid<ThreadSingleAssignmentVarBase::cancel()::'lambda'()>(ThreadSingleAssignmentVarBase::cancel()::'lambda'(), TaskPriority)) in archive contrib/foundationdb-cmake/bindings/c/libfdb_c.a
>>> referenced by ThreadHelper.actor.h:787 (/data01/minh.dao/git/branches/community_stable/ClickHouse/contrib/foundationdb/flow/include/flow/ThreadHelper.actor.h:787)
>>> MultiVersionTransaction.actor.cpp.o:(MultiVersionTransaction::setTimeout(Optional<StringRef>)) in archive contrib/foundationdb-cmake/fdbclient/libfdbclient.a
>>> referenced by ThreadHelper.actor.h:788 (/data01/contrib/foundationdb/flow/include/flow/ThreadHelper.actor.h:788)
>>> MultiVersionTransaction.actor.cpp.o:(MultiVersionTransaction::setTimeout(Optional<StringRef>)) in archive contrib/foundationdb-cmake/fdbclient/libfdbclient.a
>>> referenced 679 more times

```

Do you have any idea where is the definition of the `wait` function located in the source code?  
Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![jzhou](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jzhou/32/445_2.png) [@jzhou](https://forums.foundationdb.org/u/jzhou)\
**Post date:** [February 17, 2023, 4:39am UTC](https://forums.foundationdb.org/t/build-foundationdb-client-statically-into-another-app/3809/2 "2023-02-17T04:39:18Z")

</div>

Looks like the library was not properly compiled. `wait` is a [flow keyword](https://github.com/apple/foundationdb/tree/main/flow#wait), which will be transformed by “actor compiler” into C++ functions and callbacks. To properly compile FDB, please use the official docker image, see [instructions](https://github.com/FoundationDB/fdb-build-support).

To link with your app, you probably want to use C binding with [libfdb\_c.so](https://github.com/apple/foundationdb/releases/download/7.1.27/libfdb_c.x86_64.so). For other languages, e.g., Java, Python, Go, use corresponding language bindings with libfdb\_c.so together. Unfortunately, I can’t find these language bindings in the github download page, so you will need to compile them: `ninja -C build_output/ packages`.

You may install the client package, which comes with `fdb_c.h`, `fdb_c_options.g.h` and `libfdb_c.so`.

```auto
# rpm -qplv foundationdb-clients-7.1.27-1.el7.x86_64.rpm
drwxr-xr-x 2 root root 0 Jan 31 01:57 /etc/foundationdb
-rwxr-xr-x 1 root root 21083104 Jan 31 02:04 /usr/bin/dr_agent
-rwxr-xr-x 1 root root 21083104 Jan 31 02:04 /usr/bin/fdbbackup
-rwxr-xr-x 1 root root 20023912 Jan 31 02:04 /usr/bin/fdbcli
-rwxr-xr-x 1 root root 21083096 Jan 31 02:04 /usr/bin/fdbdr
-rwxr-xr-x 1 root root 21083104 Jan 31 02:04 /usr/bin/fdbrestore
drwxrwxr-x 2 root root 0 Jan 31 01:57 /usr/include/foundationdb
-rw-r--r-- 1 root root 42948 Jan 31 01:44 /usr/include/foundationdb/fdb.options
-rw-r--r-- 1 root root 29019 Jan 31 01:44 /usr/include/foundationdb/fdb_c.h
-rw-r--r-- 1 root root 39908 Jan 31 01:45 /usr/include/foundationdb/fdb_c_options.g.h
-rw-r--r-- 1 root root 1264 Jan 20 23:33 /usr/include/foundationdb/fdb_c_types.h
drwxrwxr-x 2 root root 0 Jan 31 01:59 /usr/lib/foundationdb/backup_agent
-rwxr-xr-x 1 root root 21083104 Jan 31 02:04 /usr/lib/foundationdb/backup_agent/backup_agent
drwxrwxr-x 2 root root 0 Jan 31 01:57 /usr/lib64/cmake/FoundationDB-Client
-rw-r--r-- 1 root root 788 Jan 31 01:44 /usr/lib64/cmake/FoundationDB-Client/FoundationDB-Client-release.cmake
-rw-r--r-- 1 root root 3190 Jan 31 01:44 /usr/lib64/cmake/FoundationDB-Client/FoundationDB-Client.cmake
-rw-r--r-- 1 root root 63 Jan 31 01:44 /usr/lib64/cmake/FoundationDB-Client/FoundationDB-ClientConfig.cmake
-rw-r--r-- 1 root root 1978 Jan 31 01:44 /usr/lib64/cmake/FoundationDB-Client/FoundationDB-ClientConfigVersion.cmake
-rwxr-xr-x 1 root root 19340512 Jan 31 02:04 /usr/lib64/libfdb_c.so
-rw-r--r-- 1 root root 173 Jan 31 01:44 /usr/lib64/pkgconfig/foundationdb-client.pc

```
