MPU6050_DMP - Error Compiling for Board Arduino Nano

I am running the MPU6050_DMP Example for Arduino Nano.
Processor - ATmega328P (Old Bootloader)

The lib is all up to date.

This error message doesn't make any sense at all.

Hopefully, there's a fix to this.
I'll try some troubleshooting and update this post.

Thanks

Github Issue Post


Arduino: 1.8.5 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

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

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

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

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeBytes(unsigned char, unsigned char, unsigned char, unsigned char*)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeByte(unsigned char, unsigned char, unsigned char)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeWords(unsigned char, unsigned char, unsigned char, unsigned int*)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeWord(unsigned char, unsigned char, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readBytes(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readByte(unsigned char, unsigned char, unsigned char*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readBit(unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeBit(unsigned char, unsigned char, unsigned char, unsigned char)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

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

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeBits(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readWords(unsigned char, unsigned char, unsigned char, unsigned int*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readWord(unsigned char, unsigned char, unsigned int*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readBitW(unsigned char, unsigned char, unsigned char, unsigned int*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::readBitsW(unsigned char, unsigned char, unsigned char, unsigned char, unsigned int*, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeBitW(unsigned char, unsigned char, unsigned char, unsigned int)'

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

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

(.text+0x0): multiple definition of `I2Cdev::writeBitsW(unsigned char, unsigned char, unsigned char, unsigned char, unsigned int)'

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

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "I2Cdev.h"
 Used: C:\Program Files (x86)\Arduino\libraries\I2Cdev
 Not used: C:\Users\mishr\Documents\Arduino\libraries\MPU6050
exit status 1
Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This error message doesn't make any sense at all.

Posting a picture of the error doesn't make sense, either.

Posting error messages from code, without posting the code, doesn't make sense, either.

It appears, though, that you are using two libraries, I2Cdev and MPU6050, that each contain I2Cdev.cpp and I2Cdev.h.

nikhilmishra:
This error message doesn't make any sense at all.

nikhilmishra:
Github Issue Post

nikhilmishra:

libraries\MPU6050\I2Cdev.cpp.o (symbol from plugin): In function `I2Cdev::I2Cdev()':

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

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

I agree that it doesn't make sense, considering that the MPU6050 library in the repository where you submitted that issue report doesn't contain a file named I2Cdev.cpp, yet somehow the copy of it on your computer does contain that file. I must assume you added that file to the MPU6050 library for some reason.

To fix this, install a fresh copy of the MPU6050 library. While you're at it, let's also get a fresh copy of I2Cdev library since I don't know whether you did something odd to that library, and you installed it to the wrong place anyway:

  • Delete C:\Program Files (x86)\Arduino\libraries\I2Cdev. Please be very careful when deleting things from your computer. When in doubt, back up!
  • Delete C:\Users\mishr\Documents\Arduino\libraries\MPU6050. Please be very careful when deleting things from your computer. When in doubt, back up!
  • Download https://github.com/jrowberg/i2cdevlib/archive/master.zip
  • Unzip the downloaded folder.
  • (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library
  • Select the Arduino\I2Cdev folder of the unzipped folder.
  • Click "Open".
  • (In the Arduino IDE) Sketch > Include Library > Add .ZIP Library
  • Select the Arduino\MPU6050 folder of the unzipped folder.
  • Click "Open".