Get Started
Install Guides
Rust
prerequisites install latest version of https //www rust lang org/tools/install setup create a new project with cargo init bin and add the following to your cargo toml file \[dependencies dittolive ditto] version = {{rust install code version}} bash cargo build usage see the https //github com/getditto/samples/tree/main/rs suggested app filesystem structure rust doesn't prescribe any particular structure for your project's layout on the end user's device filesystem the following is one recommendation approot/appexecutable the path of your app's executable everything else should be relative to this the binary component of ditto may optionally be statically linked into this executable (default) approot/libdittoffi dll the path to the binary ditto library if using the shared library version configure your app's linker to search for the library here (e g @executable path/ /libdittoffi dylib ) you will need to copy this shared library from target/\<profile>/build/dittolive ditto sys\<hash>/out when distributing your app approot/ditto data/ base directory for all locally stored ditto data cross compiling with the ditto rust sdk the rust compiler is natively capable of cross compiling for a wide range of targets you will need to configure a local cargo/config toml file in the root of your project directory to provide the necessary rustc , linker, and potentially c compiler arguments for most targets you will need to provide an alternative sysroot for your target (not host) platform, often exposing a posix c library, header files, binutils, and a linker common issues "error could not find native static library dittoffi , perhaps an l flag is missing" what should i do? diagnosis the ditto sdk build rs script failed to download an appropriate ditto binary for your target platform look at the build script's log at target/\<profile>/build/dittolive ditto sys \<hash>/stderr for any errors check your internet connection is live and ditto version number is correct inspect the downloaded library in the cargo build cache (default is target/\<profile>/build/dittolive ditto sys \<hash>/out/libdittoffi {a,dylib,so,dll} ) using your platforms utilties such as file , otool , readelf or similar try updating to the latest release of dittolive ditto you can also manually download the binary yourself solutions try updating to a more recent version of dittolive ditto manually download the library yourself and verify it completes successfully force the build script to look for the library in a specific directory by exporting dittoffi search path during compilation and execution