Archived:I Can't Compile My C/C++ Code onto My Real-Time Target Using Eclipse

Updated Dec 22, 2023

NI does not actively maintain this document.

This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.

Reported In

Hardware

  • cRIO-9082

Software

  • LabVIEW Real-Time Module

Operating System

  • PharLap

Programming Language

  • C
  • C++

Issue Details

For New Projects, a Modernized Toolchain Is Advised Instead

This article explains how to use Eclipse C/C++ Development Tools for NI Linux Real-Time to achieve cross-compiling tasks. This toolset is not actively maintained anymore. It was last updated in 2018 and is currently not advised to be used for new projects.

Instead, NI created extensive documentation for a modernized toolchain, which is easier to learn and utilize. That documentation also provides information on typical steps, like building, deploying, and debugging a shared library. If you are planning to do C/C++ development and are searching for the right toolchain, then visit Getting Started with C/C++ Development for NI Linux Real-Time.
 

Overview of the Following Eclipse-Based Content

I am following the Getting Started with C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition tutorial but I am receiving this error when trying to compile onto my cRIO-9082:

c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc/x86_64-nilrt-linux/4.9.2/ld.exe: cannot find crti.o: No such file or directory 
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc/x86_64-nilrt-linux/4.9.2/ld.exe: cannot find crtbeginS.o: No such file or directory 
c:/build/17.0/x64/sysroots/i686-nilrtsdk-mingw32/usr/bin/x86_64-nilrt-linux/../../libexec/x86_64-nilrt-linux/gcc/x86_64-nilrt-linux/4.9.2/ld.exe: hello.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC 

 

Solution

The error occurs as this tutorial can only be used specifically for Real-Time (RT) Targets running NI Linux Real-Time. In this case, the cRIO-9082 can only run the NI Phar Lap ETS and thus is not compatible with this tutorial. Older and legacy RT Targets do not support the use of NI Linux Real-Time.

To compile C code onto RT Targets running NI Phar Lap ETS National Instruments recommends you use CVI Real-Time for C-based shared libraries.

For C++, National Instruments strongly recommends using the MSVC 2009 or MSVC 2010 compilers.