Undefined Symbols Error - C API

Hello :wave:

I installed FoundationDB on my Apple Silicon Mac using the release package for aarch64.

I wrote the following code to set the version:

#define FDB_API_VERSION 710
#include <foundationdb/fdb_c.h>

int main(){

    return 0;

While compiling with clang, I received the following error:

ld: Undefined symbols:
  _fdb_select_api_version_impl, referenced from:
      _main ...

I verified that the fdb_c.h file was present where the documentation said it should be. Any help would be appreciated. Thanks

To the C noobs like me, here is how to use dynamic libraries inside macOS.

  1. Add /usr/local/lib/libfdb_c.dylib to your list of clang files during compilation.
  2. Use the following command to add the rpath:
    install_name_tool -add_rpath /usr/local/lib/ !your executable name!
  3. Run executable to check if it works