Compiler error in one sketch, but not another?

The OIT Sketch compiles fine. The panel sketch has the following error.

libraries\AltSoftSerial\AltSoftSerial.cpp.o (symbol from plugin): In function `AltSoftSerial::read()':

(.text+0x0): multiple definition of `__vector_11'

sketch\Pool_Heater_Panel_V2.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

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

OIT_V2.ino (9.65 KB)

Panel_V2.ino (8.98 KB)

ISR for Timer1 Input Capture ( TIMER1_CAPT_vect ) is being defined more than once. Check the libraries, I don't see it in your code.

Edit: If you are using a m2560 it is the pinchange interrupts in software serial.

adwsystems:
The OIT Sketch compiles fine. The panel sketch has the following error.

They seem to be different programs. Why would you expect the fact that one compiles to have any relevance for the other one?

...R

Because I made the same changes to both, at the same time, in the same place. Obviously watever the last change I made caused the issue. That change was adding AltSoftSerial. Lo and behold, the errors thrown are related to AltSoftSerial.

@tf68, actually it is duplicating the TIMER1_COMPA_vect. It is used by AltSoftSerial for the UNO as well as the sketch. I changed to timer2, it looks like the settings are the same. I will have to setup a test to make sure.

adwsystems:
Because I made the same changes to both, at the same time, in the same place. Obviously watever the last change I made caused the issue. That change was adding AltSoftSerial. Lo and behold, the errors thrown are related to AltSoftSerial.

It would have been useful if you had told us that in your Original Post

...R

I'm sorry, but I could not have added that fact into the OP. A lot of people would have simply responded that adding AltSoftSerial was the issue. Thus leaving me hanging, without actually finding the root cause. :slightly_frowning_face:

The root cause was not adding AltSoftSerial. The root cause is that my sketch and that library both use Timer1. That is the useful answer. From that answer I can make changes and progress with the project.

Ever hear the teacher's philosophy about shouting answers. When a student shouts an answer, rather than raising your hand and being called on, it stops or shifts the thought process of the other students in the class. Right or wrong, that happens on forums like this.

adwsystems:
I'm sorry, but I could not have added that fact into the OP. A lot of people would have simply responded that adding AltSoftSerial was the issue. Thus leaving me hanging, without actually finding the root cause. :slightly_frowning_face:

I don't think that would have happened if you had framed your question something like this "These two programs were both working fine but when I added AltSoftSerial to both of them one would compile and the other gave the following error. Can anyone suggest what might be the problem?"

...R

The first reply hit the answer. It wasn't a bulls eye but was in the black. The method does work. Though I suppose I could have (should have) at least asked a question, like "what the heck does this error mean?". :smiley:

Maybe you are right, if I had thought to word it exactly that way. Hindsight is 20/20. Anything less would have lead to the short answer (non-root cause) answer or to wandering discussions of irrelevant items.

I'm sorry to say, but there is a very critical tipping point around here (a very fine line), between too little and too much information versus getting constructive and useful responses. It is easier to supply more information on request, then to get folks to focus on the problem and relevant information.