Hi,
I have been working on a drone project for last 4 months and even though within this period never saw this error, after I updated the libraries or bought a new teensy 3.6 (these happened at the same time) the problem - Multiple libraries were found for "Servo.h" - showed up and I cannot solve it. I saw a post about this and I applied the things that mentioned in it but still could not solve it. There was servo library in Documents\Arduino\libraries and I deleted it but still same error and also -undefined reference to `_write' - added. I would be grateful if someone could help me. Thank you.
Here is the full error:
Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 3.6, Serial, 180 MHz, Faster, US English"
c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-writer.o): In function `_write_r':
writer.c.text._write_r+0x12): undefined reference to `_write'
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "Servo.h"
Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Servo
Not used: C:\Program Files (x86)\Arduino\libraries\Servo
Error compiling for board Teensy 3.6.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
and here is the code. This is one of the several tabs only one with servo:
I have been working on a drone project for last 4 months and even though within this period never saw this error, after I updated the libraries or bought a new teensy 3.6 (these happened at the same time) the problem - Multiple libraries were found for "Servo.h" - showed up and I cannot solve it. I saw a post about this and I applied the things that mentioned in it but still could not solve it. There was servo library in Documents\Arduino\libraries and I deleted it but still same error and also -undefined reference to `_write' - added. I would be grateful if someone could help me. Thank you.
Here is the full error:
Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 3.6, Serial, 180 MHz, Faster, US English"
c:/program files (x86)/arduino/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/lib/armv7e-m/fpu\libc.a(lib_a-writer.o): In function `_write_r':
writer.c.text._write_r+0x12): undefined reference to `_write'
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "Servo.h"
Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Servo
Not used: C:\Program Files (x86)\Arduino\libraries\Servo
Error compiling for board Teensy 3.6.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
and here is the code. This is one of the several tabs only one with servo:
Code:
#include <Servo.h>
Servo frontLeftMotor;
Servo frontRightMotor;
Servo rearLeftMotor;
Servo rearRightMotor;
void initializeMotors() {
frontLeftMotor.attach(FRONT_LEFT_MOTOR_PIN, MIN_MOTOR_PULSE_WIDTH, MAX_MOTOR_PULSE_WIDTH);
frontRightMotor.attach(FRONT_RIGHT_MOTOR_PIN, MIN_MOTOR_PULSE_WIDTH, MAX_MOTOR_PULSE_WIDTH);
rearLeftMotor.attach(REAR_LEFT_MOTOR_PIN, MIN_MOTOR_PULSE_WIDTH, MAX_MOTOR_PULSE_WIDTH);
rearRightMotor.attach(REAR_RIGHT_MOTOR_PIN, MIN_MOTOR_PULSE_WIDTH, MAX_MOTOR_PULSE_WIDTH);
stopMotors();
}
void spinMotors(struct MotorPowers motorPowers) {
frontLeftMotor.write(motorPowers.frontLeftMotorPower);
frontRightMotor.write(motorPowers.frontRightMotorPower);
rearLeftMotor.write(motorPowers.rearLeftMotorPower);
rearRightMotor.write(motorPowers.rearRightMotorPower);
}
void stopMotors() {
frontLeftMotor.write(0);
frontRightMotor.write(0);
rearLeftMotor.write(0);
rearRightMotor.write(0);
}
Last edited: