Error compiling with MeBaseboard and IDE Arduino


#1

Hi,

since a few day, it’s impossible for me to use the IDE ARDUINO for programming my robot with Me Baseboard…

When compiling I always get an error like this

libraries/makeblock/utility/avr/Servo.cpp.o: In function `__vector_17':
/Applications/Arduino.app/Contents/Java/libraries/makeblock/src/utility/avr/Servo.cpp:81: multiple definition of `__vector_17'
libraries/Servo/avr/Servo.cpp.o:/Applications/Arduino.app/Contents/Java/libraries/Servo/src/avr/Servo.cpp:81: first defined here
libraries/makeblock/utility/avr/Servo.cpp.o: In function `__vector_17':
/Applications/Arduino.app/Contents/Java/libraries/makeblock/src/utility/avr/Servo.cpp:81: multiple definition of `ServoCount'
libraries/Servo/avr/Servo.cpp.o:/Applications/Arduino.app/Contents/Java/libraries/Servo/src/avr/Servo.cpp:81: first defined here
libraries/makeblock/utility/avr/Servo.cpp.o: In function `__vector_17': ETC...

It is really annoying, and I can’t found any solution… Do you have any idea ?

All works fine with Mblock but not with the IDE Arduino, and I need the IDE Arduino for more option in my program (switch / case for exemple).

I’m with a MAC El Capitan (10.11.5), IDE arduino 1.6.9 and the library Makeblock 3.23 and I choose “arduino leonardo” in the “tools” card menu

I really appreciate some help.

Tank you :slight_smile:


#2

What is the version number of mBlock that you are using? I don’t see a 3.2.3 on the download page, so I’m assuming you are using 3.2.2.

Also, can you post the code you are trying to compile (or at least enough of it to determine what headers you are including)?


#3

Hi,

it’s works with Mblock 3.2.2, but not with IDE Arduino 1.6.9 and the Makeblock library 3.23 :wink:

Here the beginning of the code

#include <Wire.h>
#include <Servo.h>
#include <SoftwareSerial.h>
#include <MeBaseBoard.h>

double SuiveurMilieu;
double UltrasonPriorite;

MeRGBLed rgbled_8_1(8, 1, 32); // Bande Leds
MePort linefollower_7(7); // Suiveur de ligne du milieu
MeUltrasonicSensor ultrasonic_4(4); // Capteur ultrason pour la priorité à droite
MePort sw_8_2(8); // Interface - Led et bouton arrivé
MeDCMotor motor_9(9); // M1 - moteur gauche
MeDCMotor motor_10(10); // M2 - moteur droit

uint8_t moveSpeed = 150;
double lineDirIndex = 10;
double dist;

void prioriteDroite()
{
  motor_9.run(0);
  motor_10.run(0);
  delay(1000 * 2);
  lineDirIndex = 10.5;
}

Thanks for your help


#4

Try dropping the following includes:

#include <Wire.h>
#include <Servo.h>
#include <SoftwareSerial.h>

and see if that helps. You are getting redefinition errors which usually means that header files are being included more than once (and don’t have guard code in them to prevent being reincluded). Most of the examples only include the header file associated with the board and that file contains all of the other relevant header files.


#5