What is the cause of the errors “'timer0_pin_port'” and “'_vector_13'”?












0















#include "IRremote.h"

int receiver = 11;

IRrecv irReceiver(receiver);
decode_results results;

void setup() {
// put your setup code here, to run once:
pinMode(buttonPinA, INPUT_PULLUP);
pinMode(buttonPinB, INPUT_PULLUP);
pinMode(buttonPinC, INPUT_PULLUP);
pinMode(buttonPinD, INPUT_PULLUP);
irReceiver.enableIRIn();
}


The error message is:




Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':



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



librariesIRremoteIRremote.cpp.o (symbol from plugin):(.text+0x0):
first defined here



c:/program files
(x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe:
Disabling relaxation: it will not work with multiple definitions



collect2.exe: error: ld returned 1 exit status



exit status 1 Error compiling for board Arduino/Genuino Mega or Mega
2560.




I have recently discovered that "tone" and "IRremote" commands use timer2 from here. I am unaware of what timer2 really is and how to change it.










share|improve this question

























  • Do you have any definitions in your IRremote.h header file?

    – Paul
    Nov 25 '18 at 22:20











  • You should explain for problem more deeply than sharing code and error message

    – SilvioCro
    Nov 25 '18 at 22:20











  • I'll bet you could remove at least 90% of that code and still get the problem. Don't ask people to wade through all that irrelevant stuff; condense it as much as you can.

    – Pete Becker
    Nov 25 '18 at 22:37
















0















#include "IRremote.h"

int receiver = 11;

IRrecv irReceiver(receiver);
decode_results results;

void setup() {
// put your setup code here, to run once:
pinMode(buttonPinA, INPUT_PULLUP);
pinMode(buttonPinB, INPUT_PULLUP);
pinMode(buttonPinC, INPUT_PULLUP);
pinMode(buttonPinD, INPUT_PULLUP);
irReceiver.enableIRIn();
}


The error message is:




Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':



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



librariesIRremoteIRremote.cpp.o (symbol from plugin):(.text+0x0):
first defined here



c:/program files
(x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe:
Disabling relaxation: it will not work with multiple definitions



collect2.exe: error: ld returned 1 exit status



exit status 1 Error compiling for board Arduino/Genuino Mega or Mega
2560.




I have recently discovered that "tone" and "IRremote" commands use timer2 from here. I am unaware of what timer2 really is and how to change it.










share|improve this question

























  • Do you have any definitions in your IRremote.h header file?

    – Paul
    Nov 25 '18 at 22:20











  • You should explain for problem more deeply than sharing code and error message

    – SilvioCro
    Nov 25 '18 at 22:20











  • I'll bet you could remove at least 90% of that code and still get the problem. Don't ask people to wade through all that irrelevant stuff; condense it as much as you can.

    – Pete Becker
    Nov 25 '18 at 22:37














0












0








0








#include "IRremote.h"

int receiver = 11;

IRrecv irReceiver(receiver);
decode_results results;

void setup() {
// put your setup code here, to run once:
pinMode(buttonPinA, INPUT_PULLUP);
pinMode(buttonPinB, INPUT_PULLUP);
pinMode(buttonPinC, INPUT_PULLUP);
pinMode(buttonPinD, INPUT_PULLUP);
irReceiver.enableIRIn();
}


The error message is:




Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':



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



librariesIRremoteIRremote.cpp.o (symbol from plugin):(.text+0x0):
first defined here



c:/program files
(x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe:
Disabling relaxation: it will not work with multiple definitions



collect2.exe: error: ld returned 1 exit status



exit status 1 Error compiling for board Arduino/Genuino Mega or Mega
2560.




I have recently discovered that "tone" and "IRremote" commands use timer2 from here. I am unaware of what timer2 really is and how to change it.










share|improve this question
















#include "IRremote.h"

int receiver = 11;

IRrecv irReceiver(receiver);
decode_results results;

void setup() {
// put your setup code here, to run once:
pinMode(buttonPinA, INPUT_PULLUP);
pinMode(buttonPinB, INPUT_PULLUP);
pinMode(buttonPinC, INPUT_PULLUP);
pinMode(buttonPinD, INPUT_PULLUP);
irReceiver.enableIRIn();
}


The error message is:




Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':



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



librariesIRremoteIRremote.cpp.o (symbol from plugin):(.text+0x0):
first defined here



c:/program files
(x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe:
Disabling relaxation: it will not work with multiple definitions



collect2.exe: error: ld returned 1 exit status



exit status 1 Error compiling for board Arduino/Genuino Mega or Mega
2560.




I have recently discovered that "tone" and "IRremote" commands use timer2 from here. I am unaware of what timer2 really is and how to change it.







c++ arduino






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 22:58







TheRyGuy

















asked Nov 25 '18 at 22:12









TheRyGuyTheRyGuy

63




63













  • Do you have any definitions in your IRremote.h header file?

    – Paul
    Nov 25 '18 at 22:20











  • You should explain for problem more deeply than sharing code and error message

    – SilvioCro
    Nov 25 '18 at 22:20











  • I'll bet you could remove at least 90% of that code and still get the problem. Don't ask people to wade through all that irrelevant stuff; condense it as much as you can.

    – Pete Becker
    Nov 25 '18 at 22:37



















  • Do you have any definitions in your IRremote.h header file?

    – Paul
    Nov 25 '18 at 22:20











  • You should explain for problem more deeply than sharing code and error message

    – SilvioCro
    Nov 25 '18 at 22:20











  • I'll bet you could remove at least 90% of that code and still get the problem. Don't ask people to wade through all that irrelevant stuff; condense it as much as you can.

    – Pete Becker
    Nov 25 '18 at 22:37

















Do you have any definitions in your IRremote.h header file?

– Paul
Nov 25 '18 at 22:20





Do you have any definitions in your IRremote.h header file?

– Paul
Nov 25 '18 at 22:20













You should explain for problem more deeply than sharing code and error message

– SilvioCro
Nov 25 '18 at 22:20





You should explain for problem more deeply than sharing code and error message

– SilvioCro
Nov 25 '18 at 22:20













I'll bet you could remove at least 90% of that code and still get the problem. Don't ask people to wade through all that irrelevant stuff; condense it as much as you can.

– Pete Becker
Nov 25 '18 at 22:37





I'll bet you could remove at least 90% of that code and still get the problem. Don't ask people to wade through all that irrelevant stuff; condense it as much as you can.

– Pete Becker
Nov 25 '18 at 22:37












1 Answer
1






active

oldest

votes


















0














This error is a link-time issue. Two pieces of library code have both declared something with the same name (in this case it's a timer).



So the compilation was all OK, and now the linker is taking the compiled output and is wrapping it into an executable. Every time you see an error message like error: ld returned ..., know it's a link problem, and not a syntax issue. Anything ld is the linker ("ld" is the name of the linker program).



As described here:



https://forum.arduino.cc/index.php?topic=120955.msg2613823#msg2613823



Edit the header file IRRemote.h and change which timer interrupt the library uses:



Change the selection:



#define IR_USE_TIMER1   // tx = pin 9
// #define IR_USE_TIMER2 // tx = pin 3


e.g.:



// #define IR_USE_TIMER1   // tx = pin 9
#define IR_USE_TIMER2 // tx = pin 3





share|improve this answer


























  • This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

    – TheRyGuy
    Nov 25 '18 at 23:31













  • @TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

    – Kingsley
    Nov 25 '18 at 23:35











  • What do the pin numbers mean to the right of the definitions?

    – TheRyGuy
    Nov 25 '18 at 23:50











  • @TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

    – Kingsley
    Nov 26 '18 at 0:00













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53472527%2fwhat-is-the-cause-of-the-errors-timer0-pin-port-and-vector-13%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This error is a link-time issue. Two pieces of library code have both declared something with the same name (in this case it's a timer).



So the compilation was all OK, and now the linker is taking the compiled output and is wrapping it into an executable. Every time you see an error message like error: ld returned ..., know it's a link problem, and not a syntax issue. Anything ld is the linker ("ld" is the name of the linker program).



As described here:



https://forum.arduino.cc/index.php?topic=120955.msg2613823#msg2613823



Edit the header file IRRemote.h and change which timer interrupt the library uses:



Change the selection:



#define IR_USE_TIMER1   // tx = pin 9
// #define IR_USE_TIMER2 // tx = pin 3


e.g.:



// #define IR_USE_TIMER1   // tx = pin 9
#define IR_USE_TIMER2 // tx = pin 3





share|improve this answer


























  • This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

    – TheRyGuy
    Nov 25 '18 at 23:31













  • @TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

    – Kingsley
    Nov 25 '18 at 23:35











  • What do the pin numbers mean to the right of the definitions?

    – TheRyGuy
    Nov 25 '18 at 23:50











  • @TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

    – Kingsley
    Nov 26 '18 at 0:00


















0














This error is a link-time issue. Two pieces of library code have both declared something with the same name (in this case it's a timer).



So the compilation was all OK, and now the linker is taking the compiled output and is wrapping it into an executable. Every time you see an error message like error: ld returned ..., know it's a link problem, and not a syntax issue. Anything ld is the linker ("ld" is the name of the linker program).



As described here:



https://forum.arduino.cc/index.php?topic=120955.msg2613823#msg2613823



Edit the header file IRRemote.h and change which timer interrupt the library uses:



Change the selection:



#define IR_USE_TIMER1   // tx = pin 9
// #define IR_USE_TIMER2 // tx = pin 3


e.g.:



// #define IR_USE_TIMER1   // tx = pin 9
#define IR_USE_TIMER2 // tx = pin 3





share|improve this answer


























  • This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

    – TheRyGuy
    Nov 25 '18 at 23:31













  • @TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

    – Kingsley
    Nov 25 '18 at 23:35











  • What do the pin numbers mean to the right of the definitions?

    – TheRyGuy
    Nov 25 '18 at 23:50











  • @TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

    – Kingsley
    Nov 26 '18 at 0:00
















0












0








0







This error is a link-time issue. Two pieces of library code have both declared something with the same name (in this case it's a timer).



So the compilation was all OK, and now the linker is taking the compiled output and is wrapping it into an executable. Every time you see an error message like error: ld returned ..., know it's a link problem, and not a syntax issue. Anything ld is the linker ("ld" is the name of the linker program).



As described here:



https://forum.arduino.cc/index.php?topic=120955.msg2613823#msg2613823



Edit the header file IRRemote.h and change which timer interrupt the library uses:



Change the selection:



#define IR_USE_TIMER1   // tx = pin 9
// #define IR_USE_TIMER2 // tx = pin 3


e.g.:



// #define IR_USE_TIMER1   // tx = pin 9
#define IR_USE_TIMER2 // tx = pin 3





share|improve this answer















This error is a link-time issue. Two pieces of library code have both declared something with the same name (in this case it's a timer).



So the compilation was all OK, and now the linker is taking the compiled output and is wrapping it into an executable. Every time you see an error message like error: ld returned ..., know it's a link problem, and not a syntax issue. Anything ld is the linker ("ld" is the name of the linker program).



As described here:



https://forum.arduino.cc/index.php?topic=120955.msg2613823#msg2613823



Edit the header file IRRemote.h and change which timer interrupt the library uses:



Change the selection:



#define IR_USE_TIMER1   // tx = pin 9
// #define IR_USE_TIMER2 // tx = pin 3


e.g.:



// #define IR_USE_TIMER1   // tx = pin 9
#define IR_USE_TIMER2 // tx = pin 3






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 25 '18 at 23:11

























answered Nov 25 '18 at 23:06









KingsleyKingsley

3,19821328




3,19821328













  • This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

    – TheRyGuy
    Nov 25 '18 at 23:31













  • @TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

    – Kingsley
    Nov 25 '18 at 23:35











  • What do the pin numbers mean to the right of the definitions?

    – TheRyGuy
    Nov 25 '18 at 23:50











  • @TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

    – Kingsley
    Nov 26 '18 at 0:00





















  • This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

    – TheRyGuy
    Nov 25 '18 at 23:31













  • @TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

    – Kingsley
    Nov 25 '18 at 23:35











  • What do the pin numbers mean to the right of the definitions?

    – TheRyGuy
    Nov 25 '18 at 23:50











  • @TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

    – Kingsley
    Nov 26 '18 at 0:00



















This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

– TheRyGuy
Nov 25 '18 at 23:31







This makes sense, but that is located in the IRRemoteInt.h header. When I change it from timer2 to timer1 and make the sketch include IRremoteInt.h, it does not recognize the IRrecv object or any other part from IRremote.h. When I include both, The same original error message pops up..

– TheRyGuy
Nov 25 '18 at 23:31















@TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

– Kingsley
Nov 25 '18 at 23:35





@TheRyGuy - It may help to find the other code module which is causing the issue too. Keep commenting out includes and blocks of code until the error goes away. Maybe you can make a similar patch in the other library. It's a tedious method, but it works.

– Kingsley
Nov 25 '18 at 23:35













What do the pin numbers mean to the right of the definitions?

– TheRyGuy
Nov 25 '18 at 23:50





What do the pin numbers mean to the right of the definitions?

– TheRyGuy
Nov 25 '18 at 23:50













@TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

– Kingsley
Nov 26 '18 at 0:00







@TheRyGuy - There's a hardware interrupt on Pin 2 & 3, I'm not sure about pin 9 - maybe this lecture helps: courses.cs.washington.edu/courses/csep567/10wi/lectures/…

– Kingsley
Nov 26 '18 at 0:00






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53472527%2fwhat-is-the-cause-of-the-errors-timer0-pin-port-and-vector-13%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin