Solution
The error is occurring because the compiler is missing the shared library (SO) file of the NI driver that include the functions you are using in your code. To solve the issue, follow the steps below:
1.- Find the SO files of the NI drivers you are using, these files start with prefix "lib". Ensure you have installed the NI drivers required in your RT target and host PC.
- You might find some SO in the following directories of your host PC like (NI DAQmx, NI System Configuration, NI Vision, NI IMAQdx).
- for Armv7 targets: C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\arm\gcc
- for x64 targets: C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64\gcc
- In case you could not find the SO files for the NI drivers you need, you must download those shared libraries from your RT target, these files can be found in the following directories. You can retrieve them using WebDAV or any SFTP server.
- for Armv7 targets: /usr/lib/arm-linux-gnueabi/
- for x64 targets: /usr/lib/x86_64-linux-gnu/
- Other common paths: /usr/lib
NOTE: When downloading the SO files from the RT target, ensure you are not getting Symbolic Link files. You can access to the shell of your RT target and identify the actual SO files with command ls -l <searchpath> | grep -i <searchword>. Files that do not point to other files -> are the actual SO files.
2.- Open your CMakeLists.txt file and use the target_link_libraries function to link your binary with the SO files you have retrieved from your RT controller.
3.- Rerun the CMake and Ninja tasks. Sometimes the main SO library depends on auxiliary or secondary SO libraries that must be added as well to the CMakeLists.txt through the target_link_libraries function. You can try the commands below in order to find the missing auxiliary dependencies.
- ldd: Useful to display the dependencies of a shared library or binary file.
- You can install it in your RT target through opkg install ldd
- To display SO dependencies ldd <yourSOfile>

- readelf: Useful to display functions included in a shared library.
- To display SO functions readelf -Ws <yourSOfile>, you can filter the output with | grep -i <searchword> to search the undefined reference of the function you are missing.