exit status 1 Error compiling for board Arduino Nano ! help !

Hello,
this week has been a frustrating week where I can’t really understand or find a solution for this errors thrown while compiling and uploading a sketch to arduino ! I am using an arduino Nano. This error has been happening only on arduino nano and on the uno the sketch upload successfully. Please help me understand what is causing this error and what can be done to fix it ?
I have searched all over for a solution but couldn’t find anything helpful

My code sketch are in the attachment files

in my code i am including these libraries:

#include <SPI.h>
#include <RF24.h>
Arduino: 1.8.9 (Windows 10), Board: "Arduino Nano, ATmega328P"

C:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Arduino\hardware -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -built-in-libraries C:\Arduino\libraries -libraries C:\Users\ACER\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\ACER\AppData\Local\Temp\arduino_build_998875 -warnings=none -build-cache C:\Users\ACER\AppData\Local\Temp\arduino_cache_121081 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Arduino\hardware\tools\avr -verbose C:\Users\ACER\Desktop\My Project Design 2019\Work\Electronics\Display Screen\Steering_Wheel_Simulator_sketch\Steering_Wheel_Simulator_sketch.ino
C:\Arduino\arduino-builder -compile -logger=machine -hardware C:\Arduino\hardware -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -built-in-libraries C:\Arduino\libraries -libraries C:\Users\ACER\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\ACER\AppData\Local\Temp\arduino_build_998875 -warnings=none -build-cache C:\Users\ACER\AppData\Local\Temp\arduino_cache_121081 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Arduino\hardware\tools\avr -verbose C:\Users\ACER\Desktop\My Project Design 2019\Work\Electronics\Display Screen\Steering_Wheel_Simulator_sketch\Steering_Wheel_Simulator_sketch.ino
Using board 'nano' from platform in folder: C:\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Arduino\hardware\arduino\avr
Build options changed, rebuilding all
Detecting libraries used...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\sketch\\Steering_Wheel_Simulator_sketch.ino.cpp" -o nul
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\sketch\\Steering_Wheel_Simulator_sketch.ino.cpp" -o nul
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\sketch\\Steering_Wheel_Simulator_sketch.ino.cpp" -o nul
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24" "C:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src\\SPI.cpp" -o nul
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24" "-IC:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24\\utility" "C:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24\\RF24.cpp" -o nul
Generating function prototypes...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\sketch\\Steering_Wheel_Simulator_sketch.ino.cpp" -o "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\ACER\\Documents\\Arduino\\libraries\\RF24" "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\sketch\\Steering_Wheel_Simulator_sketch.ino.cpp" -o "C:\\Users\\ACER\\AppData\\Local\\Temp\\arduino_build_998875\\sketch\\Steering_Wheel_Simulator_sketch.ino.cpp.o"
In file included from C:\Users\ACER\Desktop\My Project Design 2019\Work\Electronics\Display Screen\Steering_Wheel_Simulator_sketch\Steering_Wheel_Simulator_sketch.ino:18:0:

C:\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:72:1: error: expected unqualified-id before 'class'

 class SPISettings {

 ^

C:\Arduino\hardware\arduino\avr\libraries\SPI\src/SPI.h:72:1: error: expected constructor, destructor, or type conversion before 'class'

Multiple libraries were found for "RF24.h"
 Used: C:\Users\ACER\Documents\Arduino\libraries\RF24
 Not used: C:\Users\ACER\Documents\Arduino\libraries\arduino_52154
 Not used: C:\Arduino\libraries\RF24
Using library SPI at version 1.0 in folder: C:\Arduino\hardware\arduino\avr\libraries\SPI 
Using library RF24 at version 1.3.3 in folder: C:\Users\ACER\Documents\Arduino\libraries\RF24 
exit status 1
Error compiling for board Arduino Nano.

Steering_Wheel_Simulator_sketch.ino (15.9 KB)

RF24.zip (363 KB)

Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format[/b) on your code. This will make it easier for you to spot bugs and make it easier for us to read.[/li]
  • - Edit > Copy for Forum*
  • - In a forum reply here, click on the reply field.*
    - Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • - Press “Ctrl + V”. This will paste the sketch between the code tags.*
  • - Move the cursor outside of the code tags before you add any additional text to your reply.*
  • - Repeat the above process if your sketch has multiple tabs.*
  • [/list]*
  • This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.*
  • If the sketch is longer than the 9000 characters maximum allowed by the forum, then it’s OK to add it as an attachment. After clicking the “Reply” button, you will see an “Attachments and other settings” link.*
    When your code requires a library that’s not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

pert:
Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format[/b) on your code. This will make it easier for you to spot bugs and make it easier for us to read.[/li]
  • - Edit > Copy for Forum*
  • - In a forum reply here, click on the reply field.*
    - Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • - Press “Ctrl + V”. This will paste the sketch between the code tags.*
  • - Move the cursor outside of the code tags before you add any additional text to your reply.*
  • - Repeat the above process if your sketch has multiple tabs.*
  • [/list]*
  • This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.*
  • If the sketch is longer than the 9000 characters maximum allowed by the forum, then it’s OK to add it as an attachment. After clicking the “Reply” button, you will see an “Attachments and other settings” link.*
    When your code requires a library that’s not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.
  • [/quote]*
  • hi pert,*
  • i added the sketch file in the attachment*

Unfortunately, I didn't manage to spot the error. It is very unlikely that it is in the SPI library, since you are using the official SPI library that many thousands of people use with no problems every day. I suppose it is possible that you have modified the SPI library, but if you had done so I would expect that to have been mentioned.

The next step is for me to actually compile your sketch to see if I can reproduce the error. To do that, I need to install the library that contains RF24.h. Please post a link to that library, or if you installed if via Library Manager, provide the full name of the library.

pert: Unfortunately, I didn't manage to spot the error. It is very unlikely that it is in the SPI library, since you are using the official SPI library that many thousands of people use with no problems every day. I suppose it is possible that you have modified the SPI library, but if you had done so I would expect that to have been mentioned.

The next step is for me to actually compile your sketch to see if I can reproduce the error. To do that, I need to install the library that contains RF24.h. Please post a link to that library, or if you installed if via Library Manager, provide the full name of the library.

pert, well first i added the library RF24 in the OP attached. About the SPI, what happened is that i downloaded the SPI from google from this link and added it to the libraries. What I did not know is that SPI library should already exist in the arduino but i did not change anything in the original library

firashelou: pert, well first i added the library RF24 in the OP attached. About the SPI, what happened is that i downloaded the SPI from google from this link and added it to the libraries. What I did not know is that SPI library should already exist in the arduino but i did not change anything in the original library

Well, I just tried compiling your sketch and it works fine for me. So I think the problem might be that SPI library you installed. That library is for Teensy, not for your Nano. As you learned, the SPI library is already provided so there is no reason why you would need to install one, and since this is an architecture-specific library, the Teensy SPI library may well not work for the Nano. Please uninstall and then re-install the Arduino IDE.

firashelou: Multiple libraries were found for "RF24.h" Used: C:\Users\ACER\Documents\Arduino\libraries\RF24 Not used: C:\Users\ACER\Documents\Arduino\libraries\arduino_52154 Not used: C:\Arduino\libraries\RF24

Not necessarily related to your problem, but this makes it look like you just started randomly installing copies of the RF24 library all over your computer. That is not the way to success with Arduino. Learn how to correctly install Arduino libraries and then only install a single copy of each library to the correct location. Having a bunch of different copies of the library strewn around may cause you problems and a lot of confusion in the future. My advice is to delete the unused libraries and to make sure that the library in use is the one you wanted. One thing to note is that you should never install libraries to the Arduino IDE installation folder (C:\Arduino in your case). The reason is that you will lose everything you put in that folder every time you update to a new version of the Arduino IDE. The correct place to install libraries is to the libraries subfolder of the sketchbook folder (set at File > Preferences > Sketchbook location in the Arduino IDE). If you use the Arduino IDE's library installation features then it will make sure the library is installed to the correct place automatically. So you only need to think about the library installation folder when you are doing a manual installation. More information on installing Arduino libraries: https://www.arduino.cc/en/guide/libraries

pert: Well, I just tried compiling your sketch and it works fine for me. So I think the problem might be that SPI library you installed. That library is for Teensy, not for your Nano. As you learned, the SPI library is already provided so there is no reason why you would need to install one, and since this is an architecture-specific library, the Teensy SPI library may well not work for the Nano. Please uninstall and then re-install the Arduino IDE. Not necessarily related to your problem, but this makes it look like you just started randomly installing copies of the RF24 library all over your computer. That is not the way to success with Arduino. Learn how to correctly install Arduino libraries and then only install a single copy of each library to the correct location. Having a bunch of different copies of the library strewn around may cause you problems and a lot of confusion in the future. My advice is to delete the unused libraries and to make sure that the library in use is the one you wanted. One thing to note is that you should never install libraries to the Arduino IDE installation folder (C:\Arduino in your case). The reason is that you will lose everything you put in that folder every time you update to a new version of the Arduino IDE. The correct place to install libraries is to the libraries subfolder of the sketchbook folder (set at File > Preferences > Sketchbook location in the Arduino IDE). If you use the Arduino IDE's library installation features then it will make sure the library is installed to the correct place automatically. So you only need to think about the library installation folder when you are doing a manual installation. More information on installing Arduino libraries: https://www.arduino.cc/en/guide/libraries

pert, I uninstalled arduino and reinstall it and after i selected old bootloader so now sketch is being uploaded on the nano ! thanks a lot for helping ! Karma++ :D and thanks everyone who tried to help !

You're welcome. I'm glad to hear it's working now. Enjoy! Per