C / C++
To use TileDB C API in a program, just add #include <tiledb/tiledb.h>
and specify -ltiledb
when compiling, e.g.
To use the C++ API, add #include <tiledb/tiledb>
to your C++ project instead. The TileDB C++ API requires a compiler with C++17 support, thus your project must be compiled using the C++17 standard, e.g.
If TileDB was installed in a non-default location on your system, use the -I
and -L
options:
At runtime, if TileDB is installed in a non-default location, you must make the linker aware of where the shared library resides by exporting an environment variable:
You can avoid the use of these environment variables by installing TileDB in a global (standard) location on your system, or hard-coding the path to the TileDB library at build time by configuring the rpath
, e.g.
Building your program this way will result in a binary that will run without having to configure the LD_LIBRARY_PATH
or DYLD_LIBRARY_PATH
environment variables.
Alternatively, when installing to system-wide paths known to ldconfig
(typically in /etc/ld.so.conf.d/*
or /etc/ld.so.conf
), run sudo ldconfig
after installation to update the search cache.
Last updated