NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with Eclipse building project with file paths with spaces

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. File Path Issue C.PNG

0 Kudos
Message 1 of 18
(5,028 Views)

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"

 

 

 

Charlie J.
National Instruments
0 Kudos
Message 2 of 18
(5,020 Views)

I tried both those things and the build errors did not change. Any other ideas? I appreciate any suggestions.

0 Kudos
Message 3 of 18
(5,001 Views)

How have you configured Eclipse and your system for compiling this? I can't seem to reproduce the behavior you're seeing. For testing:

  1. I set up the system variables as described in the getting started documentation
  2. I extracted the myRIO examples to "C:\This Folder Has Spaces In The Name\" 
  3. I launched Eclipse in C/C++ view with the folder I list above as the workspace (since I wasn't going to modify the examples)
  4. I used the import function in Eclipse to import all the projects:
    2019-06-07 12_07_44-C_C++ - Eclipse.png
  5. I built the project, with no errors. Here's what the output in my console looked like:
    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. 

Charlie J.
National Instruments
0 Kudos
Message 4 of 18
(4,993 Views)

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.Edits issues.PNG

 

 

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:No edits issues.PNG

Additionally, some errors at the top were related to the program arm-nilrt-linux-gnueabi-g++ instead of gcc 

0 Kudos
Message 5 of 18
(4,987 Views)

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. 

Charlie J.
National Instruments
0 Kudos
Message 6 of 18
(4,983 Views)

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.

0 Kudos
Message 7 of 18
(4,981 Views)

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'

 

 

0 Kudos
Message 8 of 18
(4,980 Views)

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.

Charlie J.
National Instruments
Message 9 of 18
(4,976 Views)

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.

Later Issue.PNG

0 Kudos
Message 10 of 18
(4,969 Views)