exit status 1

DesertElk:
it came up with this C:\Users\Caden\AppData\Local\Temp\ccjA0Rth.ltrans0.ltrans.o: In function `main':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

Every Arduino sketch must have a setup() and loop() function, even if they are left empty. Your sketch does not have a setup() function, thus the error.

Thank you so much, it is greatly appreciated

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per

Good day, am new on this platform, am trying to program an electronic bell system and i keep having exit status 1 on my Arduino IDE, i activated Compile and Upload in Preferences but nothing changed

Fonkwe:
Good day, am new on this platform, am trying to program an electronic bell system and i keep having exit status 1 on my Arduino IDE, i activated Compile and Upload in Preferences but nothing changed

Don't post pictures of code, post ALL the code.
Don't post pictures of partial error messages, post ALL the error message.

Don't hijack unrelated topics.

how do I fix this problem?

/*
Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

*/

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

Arduino: 1.8.9 (Windows Vista), Board: "Arduino/Genuino Uno"

C:\Program Files\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\Arduino\hardware -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Matt\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10809 -build-path C:\Users\Matt\AppData\Local\Temp\arduino_build_185813 -warnings=all -build-cache C:\Users\Matt\AppData\Local\Temp\arduino_cache_598200 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files\Arduino\hardware\tools\avr -verbose C:\Program Files\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files\Arduino\hardware -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\Matt\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10809 -build-path C:\Users\Matt\AppData\Local\Temp\arduino_build_185813 -warnings=all -build-cache C:\Users\Matt\AppData\Local\Temp\arduino_cache_598200 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files\Arduino\hardware\tools\avr -verbose C:\Program Files\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'uno' from platform in folder: C:\Program Files\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files\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_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\Matt\AppData\Local\Temp\arduino_build_185813\sketch\Blink.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\Matt\AppData\Local\Temp\arduino_build_185813\sketch\Blink.ino.cpp
Generating function prototypes...
"C:\Program Files\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_UNO -DARDUINO_ARCH_AVR "-IC:\Program Files\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\Matt\AppData\Local\Temp\arduino_build_185813\sketch\Blink.ino.cpp" -o "C:\Users\Matt\AppData\Local\Temp\arduino_build_185813\preproc\ctags_target_for_gcc_minus_e.cpp"
avr-g++: error: CreateProcess: No such file or directory

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

mattrenzz:
how do I fix this problem?

Close all Arduino IDE windows. Restart the IDE. Try compiling again. That will clear the temporary build folder and hopefully fix the problem.

I had the same problem. I wanted to make an LED light that is controlled with a button. but I just can't get the code right.
arduino uno and C ++

code:

int main(){

int inPin = 2;
int outPin = 13;

int state = HIGH;
int reading;
int previous = LOW;

long time = 0;
long debounce = 200;
void setup()
{
pinMode(inPin, INPUT);
pinMode(outPin, OUTPUT);
}

void loop() {
reading = digitalRead(inPin);

if (reading == HIGH && previous == LOW && millis() - time > debounce) {
if (state == HIGH)
state = LOW;
else
state = HIGH;

time = millis();
}

digitalWrite(outPin, state);

previous = reading;
}

please help me

You have a main (but where does it end?), a setup and a loop?

Here's my code[#include <pitches.h>
pitches.h pitch notes
int quaver = 500;
int crotchet = 1000;
int minim = 2000;
int semibreve = 4000;
void setup() {

}

void loop() {
tone(NOTE_A3, 8, crotchet);
tone(NOTE_A5, 8, crotchet);
tone(NOTE_FS4, 8, quaver);
tone(NOTE_D4, 8, quaver);
tone(NOTE_C5, 8, crotchet);
tone(NOTE_B3, 8, crotchet);
tone(NOTE_B4, 8, crotchet);
tone(NOTE_E4, 8, minim);
tone(NOTE_B3, 8, minim);
tone(NOTE_A5, 8, minim);
tone(NOTE_E4, 8, semibreve);
tone(NOTE_B3, 8, minim);
tone(NOTE_D4, 8, quaver);
tone(NOTE_G3, 8, quaver);
tone(NOTE_D4, 8, quaver);
tone(NOTE_B4, 8, quaver);
}] and here's pitches.h: [#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978]
I'm getting the error message and the troubleshooting is getting nowhere. How do I do this?

chrischor:
I'm getting the error message and the troubleshooting is getting nowhere. How do I do this?

Please do this:

  • When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
  • 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 error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.

What EXACTLY is "the error message"?

You've invented your own format for the tone() command. Try changing them to the version in tone() - Arduino Reference

And maybe you mean #include "pitches.h" depending on where you chose to put that file.

Steve

exit status 1
Error compiling for board Arduino Uno.

i got this error while compiling a code given in project clockie talkie
can anyone help

Adhul4351:
exit status 1
Error compiling for board Arduino Uno.

i got this error while compiling a code given in project clockie talkie
can anyone help

Same advice - post all your code, and post all the error message.
In code tags.

I am getting the error :

exit status 1
Error compiling for board Arduino Uno.

And this is my code for a robot project:
#include <Wire.h>
#include <EVShield.h>
#include <EVs_NXTTouch.h>
EVShield evshield(0x34,0x36);
EVs_NXTTouch touch1;
bool touchvalue;

/*Go forward at 50% speed.
Wait for the touch sensor to detect a wall in front.
Stop the robot and wait 2 seconds.
Back up 25 cm and then wait 2 seconds.
Make a 90 degree turn randomly left or right. (See the "Making a Random Choice" document below for info on how to make a random choice.)
Go forward briefly at 25% speed to allow the swivel wheel to straighten out.
Repeat. (by putting this code inside void loop(), it will automatically repeat).
*/

void setup() {
// put your setup code here, to run once:
//set up Ev Shield
evshield.init(SH_HardwareI2C);
//identify touch sensor
touch1.init(&evshield,SH_BBS1);

}

void loop() {
// put your main code here, to run repeatedly:

evshield.bank_a.motorRunUnlimited(SH_Motor_Both,SH_Direction_Reverse,50);
touchvalue = touch1.isPressed();

//if touch wall
if (touchvalue == 1) {
evshield.bank_a.motorRunDegrees(SH_Motor_Both,SH_Direction_Forward,50,90,SH_Completion_Wait_For,SH_Next_Action_Brake);
delay(2000);
}

while (!touchvalue) {
touchvalue = touch1.isPressed();
}

evshield.bank_a.motorStop(SH_Motor_Both,SH_Next_Action_Brake);
delay(2000);
evshield.bank_a.motorRunSeconds(SH_Motor_Both,SH_Direction_Forward,50,1500,SH_Completion_Wait_For,SH_Next_Action_Brake);
delay(2000);

int x = random(10) + 1;
if (x <= 5) {
evshield.bank_a.motorRunRotations(SH_Motor_1,SH_Direction_Reverse,50,90,SH_Completion_Wait_For,SH_Next_Action_Brake);
} else {
evshield.bank_a.motorRunRotations(SH_Motor_2,SH_Direction_Reverse,50,90,SH_Completion_Wait_For,SH_Next_Action_Brake);
}

evshield.bank_a.motorRunSeconds(SH_Motor_Both,SH_Direction_Forward,25,1000,SH_Completion_Wait_For,SH_Next_Action_Brake);

}

I am getting the error :

exit status 1
Error compiling for board Arduino Uno.

There's more than that.
Post it all.
In code tags

Arduino: 1.8.12 (Windows 10), Board: "Arduino Uno"

C:\Users\Alina\OneDrive\Documents\Arduino\Assignment3\Assignment3.ino: In function 'void loop()':

C:\Users\Alina\OneDrive\Documents\Arduino\Assignment3\Assignment3.ino:45:121: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   evshield.bank_a.motorRunSeconds(SH_Motor_Both,SH_Direction_Forward,50,1500,SH_Completion_Wait_For,SH_Next_Action_Brake);

                                                                                                                         ^

C:\Users\Alina\OneDrive\Documents\Arduino\Assignment3\Assignment3.ino:55:121: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   evshield.bank_a.motorRunSeconds(SH_Motor_Both,SH_Direction_Forward,25,1000,SH_Completion_Wait_For,SH_Next_Action_Brake);

                                                                                                                         ^

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\EVShield.cpp:1075:4: warning: #warning from EVShield: Touchscreen methods are only supported on PiStorms (getTouchscreenValues, TS_X, TS_Y, isTouched, checkButton, getFunctionButton) [-Wcpp]

   #warning from EVShield: Touchscreen methods are only supported on PiStorms (getTouchscreenValues, TS_X, TS_Y, isTouched, checkButton, getFunctionButton)

    ^~~~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp: In member function 'uint8_t* SoftI2cMaster::readRegisters(uint8_t, uint8_t, uint8_t*)':

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:163:11: error: cannot convert 'bool' to 'uint8_t* {aka unsigned char*}' in return

    return false;

           ^~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:168:11: error: cannot convert 'bool' to 'uint8_t* {aka unsigned char*}' in return

    return false;

           ^~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:173:11: error: cannot convert 'bool' to 'uint8_t* {aka unsigned char*}' in return

    return false;

           ^~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp: In member function 'char* SoftI2cMaster::readString(uint8_t, uint8_t, uint8_t*, uint8_t)':

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:246:12: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive]

  if ( x == false ) {

            ^~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp: In member function 'uint8_t SoftI2cMaster::readByte(uint8_t)':

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:254:38: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive]

   if ( readRegisters(location, 1) != false ) {

                                      ^~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp: In member function 'int16_t SoftI2cMaster::readInteger(uint8_t)':

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:264:38: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive]

   if ( readRegisters(location, 2) != false ) {

                                      ^~~~~

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp: In member function 'uint32_t SoftI2cMaster::readLong(uint8_t)':

C:\Users\Alina\OneDrive\Documents\Arduino\libraries\EVShield-master\SoftI2cMaster.cpp:274:38: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive]

   if ( readRegisters(location, 4) != false ) {

                                      ^~~~~

exit status 1
Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

It looks like you've got a problem with the library.

You have the error and you have the source, so you should be able to fix it.
If not, contact the library's author.