Go Down

Topic: Error compiling for board Arduino/Genuino Uno (Read 168 times) previous topic - next topic

sgalvin15

Hi,
I have been running and programming with 1.8.9 for a while now with no problems. This week the IDE just stopped compiling the project I've been working on. It also will not compile any program, even the stock library programs will not compile. Verbose error code below for the stock "tone_sketch_aug08b". (I replaced my user name with XXXXXXXX) I tried several new installs and deleted the Arduino15 folder. Disabled my antivirus. Any program I try to compile gives roughly the same error codes. Thanks in advance.

Code: [Select]


`__vector_7' referenced in section `.vectors' of c:/users/XXXXXXXX/downloads/arduino-1.8.9-windows/arduino-1.8.9/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr5/crtatmega328p.o: defined in discarded section `.text' of Tone.cpp.o (symbol from plugin)

`__vector_16' referenced in section `.vectors' of c:/users/XXXXXXXX/downloads/arduino-1.8.9-windows/arduino-1.8.9/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr5/crtatmega328p.o: defined in discarded section `.text' of wiring.c.o (symbol from plugin)

c:/users/XXXXXXXX/downloads/arduino-1.8.9-windows/arduino-1.8.9/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'

collect2.exe: error: ld returned 1 exit status

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




Stock program below:

Code: [Select]
// constants won't change. They're used here to
// set pin numbers:
 const int buttonPin = 2;     // the number of the pushbutton pin
 const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status
int inputPin = 5;            // variable for the speaker port
int tonetime = 600;
int tonelength = 500;
int tonefreq = 250;
void setup() {
   // initialize the LED pin as an output:
   pinMode(ledPin, OUTPUT);
   // initialize the pushbutton pin as an input:
   pinMode(buttonPin, INPUT);
}

void loop() {
   // read the state of the pushbutton value:
   buttonState = digitalRead(buttonPin);

   // check if the pushbutton is pressed.
   // if it is, the buttonState is HIGH:
   if (buttonState == HIGH) {
     // turn LED on:
     digitalWrite(ledPin, HIGH);
     delay(tonetime);
     tone(4,tonefreq,tonelength);
     delay(100);
   } else {
     // turn LED off:
     digitalWrite(ledPin, LOW);
     noTone(4);
   }
}

ballscrewbob

Forgive me if I missed something but when you say speaker is an INPUT should that not be an OUTPUT ?

Which "stock" example was this from btw ?

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

sgalvin15

#2
Mar 21, 2019, 03:38 pm Last Edit: Mar 21, 2019, 03:42 pm by sgalvin15
Our IT manager called me today to ask if the antivirus program was the culprit and I indicated that it made no difference after it was disabled. When he went to re-enable the program he realized that it was not actually disabled yesterday. When he finally disabled it this morning everything started working again.
Anti-Virus program was Carbon Black.
Thanks for the reply. I believe the problem is resolved, hope this might help someone else in the future. I'll reply with any information he finds about why the antivirus program was interfering with the IDE.

(Sorry, I tried several example programs such as BLINK etc and I thought this was one of them since it was in the same directory and I didn't write it. Not sure exactly where this code came from if it's not an example sketch.)

ballscrewbob

#3
Mar 21, 2019, 04:18 pm Last Edit: Mar 21, 2019, 04:19 pm by ballscrewbob
Antivirus is a well known culprit and is almost always a FALSE POSITIVE.

Think about it with logic and you are writing programs !
Most Antivirus works from a well known list and often gets uppity when it comes across somebody writing code it does not understand.

He needs to add exclusions for at least two of these locations depending on how your computer is set up.

Quote
C:\Program Files (x86)\Arduino
C:\Users\user\AppData\Local\Arduino15
C:\Users\user\AppData\Roaming\Arduino15
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Go Up