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.
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
Looks like the library was not properly compiled. wait is a flow keyword, which will be transformed by “actor compiler” into C++ functions and callbacks. To properly compile FDB, please use the official docker image, see instructions.
To link with your app, you probably want to use C binding with libfdb_c.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.
# 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