Issues with my libraries?

Im trying to build a self balancing robot following this tutorial DIY Self Balancing Robot using Arduino

After copy pasting the code over and transfering all of the libraries it has been giving me these error codes.

In file included from /Users/myname/Documents/Arduino/2WheelBotV2/2WheelBotV2.ino:9:0:
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050_6Axis_MotionApps20.h: In member function ‘uint8_t MPU6050::dmpGetGravity(int16_t*, const uint8_t*)’:
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050_6Axis_MotionApps20.h:522:65: warning: integer overflow in expression [-Woverflow]

  • (int32_t)qI[2] * qI[2] + (int32_t)qI[3] * qI[3]) / (2 * 16384);

^~~~~
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:436:7: warning: type ‘struct MPU6050’ violates the C++ One Definition Rule [-Wodr]
class MPU6050 {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:436:7: note: a different type is defined in another translation unit
class MPU6050 {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:1036:18: note: the first difference of corresponding definitions is field ‘dmpPacketBuffer’
uint8_t *dmpPacketBuffer;
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:436:7: note: a type with different number of fields is defined in another translation unit
class MPU6050 {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:440:14: warning: ‘initialize’ violates the C++ One Definition Rule [-Wodr]
void initialize();
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:56:6: note: implicit this pointer type mismatch
void MPU6050::initialize() {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:436:7: note: type ‘struct MPU6050’ itself violates the C++ One Definition Rule
class MPU6050 {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:56:6: note: ‘initialize’ was previously declared here
void MPU6050::initialize() {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:56:6: note: code may be misoptimized unless -fno-strict-aliasing is used
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:441:14: warning: ‘testConnection’ violates the C++ One Definition Rule [-Wodr]
bool testConnection();
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:67:6: note: implicit this pointer type mismatch
bool MPU6050::testConnection() {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:436:7: note: type ‘struct MPU6050’ itself violates the C++ One Definition Rule
class MPU6050 {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:67:6: note: ‘testConnection’ was previously declared here
bool MPU6050::testConnection() {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:67:6: note: code may be misoptimized unless -fno-strict-aliasing is used
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:767:14: warning: ‘setXGyroOffset’ violates the C++ One Definition Rule [-Wodr]
void setXGyroOffset(int16_t offset);
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:2929:6: note: implicit this pointer type mismatch
void MPU6050::setXGyroOffset(int16_t offset) {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:436:7: note: type ‘struct MPU6050’ itself violates the C++ One Definition Rule
class MPU6050 {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:2929:6: note: ‘setXGyroOffset’ was previously declared here
void MPU6050::setXGyroOffset(int16_t offset) {
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:2929:6: note: code may be misoptimized unless -fno-strict-aliasing is used
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.h:771:14: warning: ‘setYGyroOffset’ violates the C++ One Definition Rule [-Wodr]
void setYGyroOffset(int16_t offset);
^
/Users/myname/Documents/Arduino/libraries/MPU6050_6Axis_MotionApps20/MPU6050.cpp:2939:6: note: implicit this pointer type mismatch
void MPU6050::setYGyroOffset(int16_t offset) {
^

This isn’t all of the error code because it is way to long but hopefully this is enough to get the gist of the issue.

Any help is appreciated .

You may be including one or more header files more than once.

You need to understand the difference between warnings and errors. A warning is the compiler telling you there is something in the code that could possibly cause a problem but doesn't cause the compilation to fail. An error is a problem with the code that causes compilation to fail. In this case you have posted warnings, not errors.

You should always pay attention to warnings and fix them in your own code whenever possible. Unfortunately some library authors don't hold themselves to such high standards so sometimes you do just need to ignore a warning from a library that you didn't write. That can be quite annoying since you are always having to sort though a bunch of warnings in other people's sloppy code to make sure your own code is of high quality. You may decide it's worth editing the source of the library to fix the warning. If you do so, it's a good idea to submit a pull request for the fix to the library's repository to solve the problem upstream, otherwise the warnings will come back whenever you update to a new release of the library. This will also benefit all the other users of the library.