user9922: Im using Spark fun pro micro:https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro
I am controlling a servo motor which reads its data from a pot connected to A0, and then writes to the servo on D9.
A speaker is connected to A5. Im using tone()
If I comment out the servo part of it, the tone() works out just fine and vise versa..
The error message I get is "multiple definition of `__vector_32'"
Got a clue??! 
Thanks! 

user-1: The libraries are not compatible with each other, welcome to Arduino.
I dont use either library, and usually avoid libraries altogether because of things like this. I will assume you want a solution, not a clue.
The quickest route is to pick one of the libraries, and globally modify __vector_32 to something like __vector_32x. 
That probably is not the best solution but the quickest. The best solution would be to understand how it is used in both libraries, and modify them to work together. In the end it might be as simple as wrapping it with some #ifdef, but that requires understanding it enough to get to that conclusion, and it will take some time.  Maybe someone else already has.

user7508: The link you provided shows a board built around the ATmega32U4.
On this chip, “__vector_32” is the low-level name of an ISR
(Interrupt Service Routine) named “TIMER3_COMPA_vect”. Your problem
comes from having two libraries trying to define an ISR for the same
interrupt, which is generated by the timer 3 of the chip. Merging
the ISRs is actually unlikely to work, because since each library
configures the timer in its own way, the timing of the interrupts will
be wrong for at least one of the libraries. You really have to use
different timers.
On my copy of Tone.cpp I can read:
#elif defined(__AVR_ATmega32U4__)

#define AVAILABLE_TONE_PINS 1
#define USE_TIMER3

const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 3 /*, 1 */ };
static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255 */ };

which shows that the code is configured to use timer 3 on this
particular chip. In Servo.h I have:
#elif defined(__AVR_ATmega32U4__)  
#define _useTimer1 
typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;

which shows it should use timer 1, and not conflict with Tone.cpp.
It seems we have different versions of Servo.h. Mine is from Arduino
1.0.5. You may try to fix the problem by modifying the relevant section
of either file (just after #elif defined(__AVR_ATmega32U4__)) and
have them use different timers.
Edit: It appears this issue has already been fixed... on June 2012!
See this diff: Avoid TIMER3 conflict with Servo and
tone()
on the Arduino GitHub repository. The simplest fix in your case may be
to just upgrade your Arduino software. You could also manually apply
that (really small) diff to your current copy.

user1677: The problem you're seeing arises when two codes (e.g. libraries) try to use the same interrupt. 
If you look at the source code of the two libraries, you'll find that they both make use of a number of ISRs (interrupt service routines): Tone.cpp uses
ISR(TIMERn_COMPA_vect) {...}

for n = 0..5, while Servo.cpp uses
ISR(TIMERn_COMPA_vect) {...}

for n = 1, 3, 4, 5.
Now what happens when you compile this code is that they both libraries generate identical symbols (the __vector_32 part) which then clash when the compiled code is linked to give the final binary you'd upload to your Arduino.
There is no simple way around this because the interrupt handlers need to be  registered at certain fixed positions in flash memory and there can only be exactly one interrupt handler for each of these slots (these slots are simply entries in a look-up table with the addresses of the interrupt handlers in flash, cf. Table 9-1 in the datasheet).
Now to solve this problem you would need to find a way to either merge the interrupt handlers of the two libraries (not so easy I guess), or make them use different interrupts (without looking further into what options the pro micro offers, the code suggests that there are several TIMER interrupts which could be assigned one to the Servo, one to the Tone, if that is supported by the hardware).
In any case you'll not get around modifying the libraries (or writing your own code for one functionality or the other).

9922: <p>Im using Spark fun pro micro:<a href="https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro" rel="nofollow">https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro</a></p>

<p>I am controlling a servo motor which reads its data from a pot connected to A0, and then writes to the servo on D9.</p>

<p>A speaker is connected to A5. Im using tone()</p>

<p>If I comment out the servo part of it, the tone() works out just fine and vise versa..
The error message I get is "multiple definition of `__vector_32'"</p>

<p>Got a clue??! 
Thanks! </p>
 -1: <p>The libraries are not compatible with each other, welcome to Arduino.</p>

<p>I dont use either library, and usually avoid libraries altogether because of things like this. I will assume you want a solution, not a clue.</p>

<p>The quickest route is to pick one of the libraries, and globally modify __vector_32 to something like __vector_32x. </p>

<p>That probably is not the best solution but the quickest. The best solution would be to understand how it is used in both libraries, and modify them to work together. In the end it might be as simple as wrapping it with some #ifdef, but that requires understanding it enough to get to that conclusion, and it will take some time.  Maybe someone else already has.</p>
 7508: <p>The link you provided shows a board built around the ATmega32U4.
On this chip, “__vector_32” is the low-level name of an ISR
(Interrupt Service Routine) named “TIMER3_COMPA_vect”. Your problem
comes from having two libraries trying to define an ISR for the same
interrupt, which is generated by the timer&nbsp;3 of the chip. Merging
the ISRs is actually unlikely to work, because since each library
configures the timer in its own way, the timing of the interrupts will
be wrong for at least one of the libraries. You really have to use
different timers.</p>

<p>On my copy of Tone.cpp I can read:</p>



<pre class="lang-c++ prettyprint-override"><code>#elif defined(__AVR_ATmega32U4__)

#define AVAILABLE_TONE_PINS 1
#define USE_TIMER3

const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 3 /*, 1 */ };
static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255 */ };
</code></pre>

<p>which shows that the code is configured to use timer 3 on this
particular chip. In Servo.h I have:</p>

<pre class="lang-c++ prettyprint-override"><code>#elif defined(__AVR_ATmega32U4__)  
#define _useTimer1 
typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;
</code></pre>

<p>which shows it should use timer 1, and not conflict with Tone.cpp.</p>

<p>It seems we have different versions of Servo.h. Mine is from Arduino
1.0.5. You may try to fix the problem by modifying the relevant section
of either file (just after <code>#elif defined(__AVR_ATmega32U4__)</code>) and
have them use different timers.</p>

<p><strong>Edit</strong>: It appears this issue has already been fixed... on June 2012!
See this diff: <a href="https://github.com/arduino/Arduino/commit/f60f17f79ae383a948a9cc4baa8bd0983fad6465" rel="nofollow">Avoid TIMER3 conflict with Servo and
tone()</a>
on the Arduino GitHub repository. The simplest fix in your case may be
to just upgrade your Arduino software. You could also manually apply
that (really small) diff to your current copy.</p>
 1677: <p>The problem you're seeing arises when two codes (e.g. libraries) try to use the same interrupt. </p>

<p>If you look at the source code of the two libraries, you'll find that they both make use of a number of ISRs (interrupt service routines): <code>Tone.cpp</code> uses</p>

<pre><code>ISR(TIMERn_COMPA_vect) {...}
</code></pre>

<p>for n = 0..5, while <code>Servo.cpp</code> uses</p>

<pre><code>ISR(TIMERn_COMPA_vect) {...}
</code></pre>

<p>for n = 1, 3, 4, 5.</p>

<p>Now what happens when you compile this code is that they both libraries generate identical symbols (the <code>__vector_32</code> part) which then clash when the compiled code is linked to give the final binary you'd upload to your Arduino.</p>

<p>There is no simple way around this because the interrupt handlers need to be  registered at certain fixed positions in flash memory and there can only be exactly one interrupt handler for each of these slots (these slots are simply entries in a look-up table with the addresses of the interrupt handlers in flash, cf. Table 9-1 in the <a href="http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf" rel="nofollow">datasheet</a>).</p>

<p>Now to solve this problem you would need to find a way to either merge the interrupt handlers of the two libraries (not so easy I guess), or make them use different interrupts (without looking further into what options the pro micro offers, the code suggests that there are several TIMER interrupts which could be assigned one to the Servo, one to the Tone, <em>if</em> that is supported by the hardware).</p>

<p>In any case you'll not get around modifying the libraries (or writing your own code for one functionality or the other).</p>
