# Genie Sample Code Tutorial Warning Genie source code examples are subject to change without notice. ## Prerequisites - Building *libGenie.so* has three external dependencies: - 1. clang compiler 2. ndk-build (for Android targets only) 3. Rust If the clang compiler is not available in your system `PATH`, the script **${QNN\_SDK\_ROOT}/bin/check-linux-dependency.sh** provided with the SDK can be used to install and prepare your environment on Linux. The Windows equivalent script is **${QNN\_SDK\_ROOT}\bin\check-windows-dependency.ps1**. Alternatively, you could install these dependencies and make them available in your `PATH`. Command to automatically install required dependencies: # On Linux sudo bash ${QNN_SDK_ROOT}/bin/check-linux-dependency.sh Copy to clipboard # On Windows (VS Developer Command Prompt) & "\bin\check-windows-dependency.ps1" Copy to clipboard For the second dependency to be satisfied, ndk-build needs to be available in your `PATH`. This should only be needed for builds on Linux for Android. You can check your environment with: # On Linux ${QNN_SDK_ROOT}/bin/envcheck -n Copy to clipboard Note libGenie.so has been verified to work with Android NDK version r26c and clang14. For the third dependency, Rust, run the following set of commands in the terminal corresponding to the platform you are building on: # On Linux export RUSTUP_HOME=/path/for/rustup mkdir -p ${RUSTUP_HOME} export CARGO_HOME=/path/for/cargo mkdir -p ${CARGO_HOME} curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh source ${CARGO_HOME}/env rustup target add aarch64-linux-android Copy to clipboard # On Windows (VS Developer Command Prompt) set RUSTUP_HOME=C:\path\for\rustup if not exist "%RUSTUP_HOME%" mkdir "%RUSTUP_HOME%" set CARGO_HOME=C:\path\for\cargo if not exist "%CARGO_HOME%" mkdir "%CARGO_HOME%" curl -L -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y set PATH=%CARGO_HOME%\bin;%PATH% Copy to clipboard Note The initial Windows installation of Rust only installs the standard library for your host platform - that is, the architecture and operating system you are presently running on. To compile Genie.dll for other platforms, you must install other target platforms. For example, if you want to build for ARM64, run the following command in the VS Developer Command Prompt: rustup target add aarch64-pc-windows-msvc Copy to clipboard ## Building the Genie library **x86** cd ${SDK_ROOT}/examples/Genie/Genie make x86 Copy to clipboard After executing make as shown above, you should be able to see *libGenie.so* in lib/x86\_64-linux-clang. **OE** cd ${SDK_ROOT}/examples/Genie/Genie export OE_TOOLCHAIN_ROOT=PATH_OF_OE_LINUX_GCC_11.2 make oe Copy to clipboard After executing make as shown above, you should be able to see *libGenie.so* in lib/aarch64-oe-linux-gcc11.2. **Android** cd ${SDK_ROOT}/examples/Genie/Genie make android Copy to clipboard After executing make as shown above, you should be able to see *libGenie.so* in lib/aarch64-android. You can now proceed to link this library to your app and call APIs exposed by *libGenie.so*. **Windows** # On Windows (VS Developer Command Prompt) cd ${SDK_ROOT}/examples/Genie/Genie # Optional: If you wish to build for Windows ARM64 platform... rustup target add aarch64-pc-windows-msvc mkdir build && cd build cmake ../ -A cmake --build ./ --config Release Copy to clipboard You should now be able to see *Genie.dll* in lib/Release. Last Published: Aug 06, 2026 [Previous Topic Source Code Examples](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/source_code_examples.md) [Next Topic genie-t2t-run](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/source_code_examples_genie-t2t-run.md)