Arduino "Exit Status 1" error

I am a student, trying to use the arduino IDE to run an extremely simple code. I am using an arduino UNO. Whenever I atttempt to run a code, I get this message. I am using a verbose editor. The code is very long, so I will just post the error location. Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Allan\AppData\Local\Temp\build089a00a29a94924c0038b78274ac97e2.tmp/core\core.a(main.cpp.o): In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

The code I am trying to use is this:
void on(char pin, long time) {
digitalWrite(13, HIGH);
delay(1000);
}

You're missing a few parts.

void setup(){
}
void loop(){
}

void on(char pin, long time) {
 digitalWrite(13, HIGH);
 delay(1000);
}

Then put some code in setup() or loop() to call on( ).
Tho I don't know why you'd hardcode the pin # (13) and the delay when you appear to want to pass them in as variable.
Might just as well have this

void on( ) {
 digitalWrite(13, HIGH);
 delay(1000);
}

You need 3 more of }
to close out all the open { ones.
Can add them at the end of your code to complete compiling, may not be the right place for your logic.

i got the same problem, the reason was the destination at Preferences

make it the default

Hello All,

I am trying to figure out how to get around this error? Google led me to the forum and I am not seeing anything I can reset or set per say that would make the error go bye bye. It appears that the IDE tools can’t compile the code per say? thats my best understanding to this point. I have attached the file I have been working off of also.

Thanks Again for any help on this.

Environment: Mac with OSX10.11.6 with He3D TriColor 3D Printer using the Mega 2560 board.

Arduino: 1.6.13 (Mac OS X), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

“/Users/waterkc/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/bin/avr-gcc” -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,–gc-sections,–relax -mmcu=atmega2560 -o

“/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/Repetier.ino.elf” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/BedLeveling.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Commands.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Communication.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Drivers.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Eeprom.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Extruder.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Printer.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/Repetier.ino.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/SDCard.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/SdFat.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/gcode.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/motion.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/ui.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/uilang.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/libraries/SPI/SPI.cpp.o” “/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/core/core.a” “-L/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212” -lm
/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/SdFat.cpp: In member function ‘open’:
/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/SdFat.cpp:1322:37: warning: ‘cVFATFoundCur’ may be used uninitialized in this function [-Wmaybe-uninitialized]
for(int8_t i=0;i< cVFATFoundCur - cVFATNeeded;i++)
^
/var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/SdFat.cpp:1140:28: note: ‘cVFATFoundCur’ was declared here
int8_t cVFATNeeded = -1, cVFATFoundCur;
^
stepperWait' referenced in section .text’ of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T//ccT4JvZ2.ltrans5.ltrans.o: defined in discarded section .text' of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o (symbol from plugin) stepperWait’ referenced in section .text' of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T//ccT4JvZ2.ltrans5.ltrans.o: defined in discarded section .text’ of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o (symbol from plugin)
stepperWait' referenced in section .text’ of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T//ccT4JvZ2.ltrans5.ltrans.o: defined in discarded section .text' of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o (symbol from plugin) stepperWait’ referenced in section .text' of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T//ccT4JvZ2.ltrans5.ltrans.o: defined in discarded section .text’ of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o (symbol from plugin)
stepperWait' referenced in section .text’ of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T//ccT4JvZ2.ltrans5.ltrans.o: defined in discarded section .text' of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o (symbol from plugin) stepperWait’ referenced in section .text' of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T//ccT4JvZ2.ltrans5.ltrans.o: defined in discarded section .text’ of /var/folders/g1/f3z5f4310yn242q1dr0zxy_c0000gn/T/arduino_build_815212/sketch/HAL.cpp.o (symbol from plugin)
collect2: error: ld returned 1 exit status
Using library SPI at version 1.0 in folder: /Users/waterkc/Library/Arduino15/packages/arduino/hardware/avr/1.6.17/libraries/SPI
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

New to Arduino, I have no problems with connecting my Arduino UNO to my Macbook Pro and downloading sketches. However on downloading the Arduino software to my iMac, I get:
"1d returned 1 exit error status" whenever I try to upload any sketches from 'Basics'.

Using OS x 10.7.5
Port /dev/cu.usmodemfa121

Any ideas?

i too have this kind of erroe status 1

You need to post the full text of your error messages, and unless it's an exact match to what is posted in another thread, make a new thread, because it's not the same error.

"exit status 1" just means the compiler reported failure - it's the last thing it outputs in a failure; you'll get it from bizzaro stuff like what waterkc encountered, and you'll get it if you misspell a variable name - you need to look at the output above it to see why it failed, which may tell you how to fix it. Use the button to copy the whole output to post it, so we have all the information we need to help (otherwise the first response will be "please post the full error" )

And we have some people saying ld reported exit status 1 (meaning it failed at the linker stage), and others saying exit status 1 (meaning that came from the compiler)