This series of tutorials provides an introduction to compiling C/C++ code using the NI Linux Real-Time GNU C/C++ Toolchains and Visual Studio Code. The attached documents introduce the concept of cross compiling, provide instructions on how to configure third-party tools and Visual Studio Code as an example of tools for use with the NI toolchain, and walk through several example use cases such as a "Hello, World!" application.
For an alternative approach, refer to Developing C/C++ Code for NI Linux Real-Time with the Visual Studio Code Remote Development Extensio....
The tutorial documents attached to this page cover a large range of topics related to building and deploying C/C++ code to NI Linux Real-Time devices. The tutorials are as follows:
The requirements for each tutorial differ, but in general all tutorials require a system configured as described in Part 2 - Configuring a Development System with Visual Studio Code and the NI Linux RT Compilers and in Part 3 - Configuring Visual Studio Code for Building NI Linux RT Code. Debugging or deploying code additionally requires a system running NI Linux Real-Time with software installed.
On Part 6, step 6, I get the following error:
I have confirmed that I have I have ‘myLib.h’ in the proper directory:
And I believe my c_cpp_properties.json is set correctly:
Any ideas on what could be causing the issue? Thanks for any help you can provide!
@Russell_G, I know this potential solution comes 3 months late late, but I just finished tutorial and ran into the same problem. Hopefully this helps someone else (or prompts a correction to the material). The problem is not from the c_cpp_properties.json file; the error is in the CMakeList.txt file. You'll find that there is a nomenclature change from 'toolchainpath' in Part 3 to 'toolchain_path' in Part 6. If you built your file with 'toolchainpath' as the sysroot location variable, you'll run into this problem. I ended up catching this error early when I compared my CMakeList file to the one that came as an attachment to the tutorial (the attachment file uses the underscore '_'). See the screenshots below:
Part 3 Instructions:
Part 6 Instructions:
This is an excellent tutorial, but this discrepancy should be fixed. Although, it did help me understand a bit more what the files were all about when debugging this problem.