06-06-2019 03:16 PM
I am trying to run the PWM sample code in C with "C & C++ Development Tools for NI Linux Real-Time 2017, Eclipse Edition and when I am building the project I run into the error of "No such file or directory" when the program should be looking for c:/Users/Preferred Customer/Desktop/C_Support_for_myRIO_v6.0/C Support for myRIO/source.
I have had repeated issues with the file paths where the program looks in the wrong spot. Additionally, libvisa.so and some other key files were not in the correct file location.
Instead the program spits out these errors:
arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-Ic:/Users/Preferred Customer/Desktop/C_Support_for_myRIO_v6.0/C Support for myRIO/source" "-IC:\\Users\\Preferred Customer\\Desktop\\C_Support_for_myRIO_v6.0\\C Support for myRIO\\source" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\Users\\Preferred" "Customer\\Desktop\\C_Support_for_myRIO_v6.0\\C" Support for "myRIO\\source" -o main.o "..\\main.c"
arm-nilrt-linux-gnueabi-gcc: error: Customer\Desktop\C_Support_for_myRIO_v6.0\C: No such file or directory
arm-nilrt-linux-gnueabi-gcc: error: Support: No such file or directory
arm-nilrt-linux-gnueabi-gcc: error: for: No such file or directory
arm-nilrt-linux-gnueabi-gcc: error: myRIO\source: No such file or directory
It appears that it is splitting up that file location based on the spaces. I have attempted to add quotes around the file path but that has not worked. I am working on windows 10 professional. Any ideas?
Eventually I will be using a myRIO with one pin outputting the PWM signal.
06-06-2019 03:56 PM
You're on the right track with the quotes. Not 100% sure, but I think the issue is that you've put quotes around the include flag and the path as opposed to just the path or with how the spaces are handled.
Try the following:
-I "c:/Users/Preferred Customer/Desktop/C_Support_for_myRIO_v6.0/C Support for myRIO/source"
You might try escaping the spaces as well:
-I "c:/Users/Preferred Customer/Desktop/C_Support_for_myRIO_v6.0/C\ Support\ for\ myRIO/source"
06-07-2019 08:37 AM
I tried both those things and the build errors did not change. Any other ideas? I appreciate any suggestions.
06-07-2019 12:09 PM
How have you configured Eclipse and your system for compiling this? I can't seem to reproduce the behavior you're seeing. For testing:
Info: Internal Builder is used for build arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-IC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "-IC:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o "C_Support\\IRQConfigure.o" "..\\..\\C Support for myRIO\\source\\IRQConfigure.c" arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-IC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "-IC:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o ".metadata\\.plugins\\org.eclipse.cdt.make.core\\specs.o" "..\\.metadata\\.plugins\\org.eclipse.cdt.make.core\\specs.c" arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-IC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "-IC:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o "C_Support\\MyRio.o" "..\\..\\C Support for myRIO\\source\\MyRio.c" arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-IC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "-IC:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o main.o "..\\main.c" arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-IC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "-IC:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o PWM.o "..\\PWM.c" arm-nilrt-linux-gnueabi-gcc -DMyRio_1900 "-IC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "-IC:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi/usr/include" -O0 -g3 -Wall -c -fmessage-length=0 -mfpu=vfpv3 -mfloat-abi=softfp "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o "C_Support\\NiFpga.o" "..\\..\\C Support for myRIO\\source\\NiFpga.c" arm-nilrt-linux-gnueabi-gcc "-LC:\\This Folder Has Spaces In The Name\\C Support for myRIO\\source" "--sysroot=C:\\build\\17.0\\arm\\sysroots\\cortexa9-vfpv3-nilrt-linux-gnueabi" -o "myRIO Example - PWM" main.o PWM.o "C_Support\\NiFpga.o" "C_Support\\MyRio.o" "C_Support\\IRQConfigure.o" ".metadata\\.plugins\\org.eclipse.cdt.make.core\\specs.o" -ldl -lvisa -lpthread
From this, it seems like there's something else wrong with your configuration. Did you change anything in the example files? It should automatically generate the include paths based on the workspace location.
06-07-2019 01:03 PM
Thanks for the replies Charlie,
For what I was doing before the only difference is that I did not have the workspace as the same folder as where I extracted the myRIO examples because I was going to modify the examples eventually. However I did not modify them originally, I wanted to get the program to run and then I will edit the program after. However, unfortunately I did not get the program to run.
Since my last reply I have started from scratch with redownloading the examples and starting a new workspace, additionally I chose to change my username to avoid the space and had manually changed some of the file paths that had spaces to underscores. Additionally, I copied and pasted some files into locations that it was able to check and also added the #include "MyRio1900.h" line as well as some other smaller tweaks to get rid of a variety of errors that were popping up and I was making progress but ran into this and can't get past it.
Since seeing your success building the project with no errors I followed your 4 steps exactly, including using the folder that has the extracted myRIO examples as the workspace (since I wasn't going to modify them and just wanted to see the program build). It resulted in this:
Additionally, some errors at the top were related to the program arm-nilrt-linux-gnueabi-g++ instead of gcc
06-07-2019 01:20 PM
Hi GROE,
The gcc/c++ errors are likely to do with your User Environment Variable settings. There are some (somewhat confusing) instructions in the C_Support_for_myRIO_User_Guide.pdf that ships in the "<extracted location>\C Support for myRIO\documentation" folder. Can you confirm that you added the environment variables described on page 2 in steps 5 and 6? Without these, Eclipse won't find the compiler. Note that you'll have to restart Eclipse after this change.
Another comment: Manually changing the file paths might introduce problems. For example, the warning in your bottom screenshot points to you removing spaces from the "C Support for myRIO" directory which prevents the path from resolving properly.
06-07-2019 01:33 PM
I agree, the errors I am receiving seem to be related to my User Environment Variable settings. Confirming, I had and am still setting up the software environment described in the following link http://download.ni.com/support/softlib//labview/labview_myrio/2018/C_Support_for_myRIO_User_Guide.pd... on page 2 in steps 5 and 6. Additionally, I have been restarting Eclipse after changing the enviornment paths because I understand that Eclipse will use the paths that were declared?/assigned?/defined? that were present at the opening of the program.
Comment to your additional comment: I agree that manually changing the file paths might produce problems. However, I would like to point out that my bottom screenshot that you say points to me removing spaces from the "C Support for myRIO" was actually a screenshot resulting from me changing nothing. The top screenshot was with me improvising from the directions provided by National Instruments and messing around with the spaces,paths,code, etc. This top screenshot was my best and multiple attempts at fixing all the errors.
The bottom screenshot was what happened when I followed your 4 steps along with the instructions provided in the "C Support for myRIO 6.0 User Guide". (The same link that I provided earlier in this post.
06-07-2019 01:43 PM - edited 06-07-2019 01:44 PM
Whoops.... for the bottom screenshot, I had forgot to rename the file directories in my computer. I got that fixed and am now getting the exact same errors as the top screenshot. So in summary:
I have 2 workspaces in different locations looking at slightly different file paths
"Workspace Unedited" - following directly the National Instruments and your instructions - workspace is in the same file location as the examples - gives errors 'Program "arm-nilrt-linux-gnueabi-g++" not found in PATH' and 'Program "arm-nilrt-linux-gnueabi-gcc" not found in PATH'
"Workspace Edited" - Tweaked many things previously listed - workspace is in DIFFERENT file location as the examples - gives errors 'Program "arm-nilrt-linux-gnueabi-g++" not found in PATH' and 'Program "arm-nilrt-linux-gnueabi-gcc" not found in PATH'
06-07-2019 01:51 PM
I completely forgot about this problem, but:
Note An error 'Program "g++" not found in PATH' or 'Program "gcc" not found in PATH" may appear in the Problems tab during the build even though the build is successful. These errors can be safely ignored and removed by Right-Clicking the error and selecting Delete.
(from our Getting Started with C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition tutorial)
What's the output in your console after trying to build? You might want to clean first.
06-07-2019 02:02 PM
After deleting, cleaning, and restarting the program built without an issue.
However it seems I just can't get away with just that... After following the building and deploying page of the support i get this error when trying to run the example of the myRIO target after step 12.