How to fix dji_irp: error while loading shared libraries: libdirp.so: cannot open shared object file: No such file or directory

Problem:

When you try to run dji_irp from the DJI thermal SDK on Linux, you see the following error message:

./utility/bin/linux/release_x64/dji_irp: error while loading shared libraries: libdirp.so: cannot open shared object file: No such file or directory

Solution:

The libdirp.so library is included with the SDK but it is in a subfolder (the same subfolder where dji_irp is located) where the shell can’t find it.

In order to fix the issue, prefix the command you’re using with

LD_LIBRARY_PATH=./utility/bin/linux/release_x64/

For example:

LD_LIBRARY_PATH=./utility/bin/linux/release_x64/ ./utility/bin/linux/release_x64/dji_irp