exit status 1 Error compiling for board Arduino/Genuino Uno.

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

Build options changed, rebuilding all
In file included from C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1\sketch_1.ino:9:0:

sketch\MPU6050_6Axis_MotionApps20.h: In member function 'uint8_t MPU6050::dmpGetGravity(int16_t*, const uint8_t*)':

sketch\MPU6050_6Axis_MotionApps20.h:693:65: warning: integer overflow in expression [-Woverflow]

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

^

C:\Users\MALHAR~1\AppData\Local\Temp\cchG4dmd.ltrans0.ltrans.o: In function `setup':

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:52: undefined reference to `MPU6050::initialize()'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:56: undefined reference to `MPU6050::testConnection()'

C:\Users\MALHAR~1\AppData\Local\Temp\cchG4dmd.ltrans0.ltrans.o: In function `dmpInitialize':

sketch/MPU6050_6Axis_MotionApps20.h:336: undefined reference to `MPU6050::reset()'

sketch/MPU6050_6Axis_MotionApps20.h:347: undefined reference to `MPU6050::setSleepEnabled(bool)'

sketch/MPU6050_6Axis_MotionApps20.h:351: undefined reference to `MPU6050::setMemoryBank(unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:353: undefined reference to `MPU6050::setMemoryStartAddress(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:358: undefined reference to `MPU6050::setMemoryBank(unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:367: undefined reference to `MPU6050::getXGyroOffsetTC()'

sketch/MPU6050_6Axis_MotionApps20.h:368: undefined reference to `MPU6050::getYGyroOffsetTC()'

sketch/MPU6050_6Axis_MotionApps20.h:369: undefined reference to `MPU6050::getZGyroOffsetTC()'

sketch/MPU6050_6Axis_MotionApps20.h:379: undefined reference to `MPU6050::setSlaveAddress(unsigned char, unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:381: undefined reference to `MPU6050::setI2CMasterModeEnabled(bool)'

sketch/MPU6050_6Axis_MotionApps20.h:383: undefined reference to `MPU6050::setSlaveAddress(unsigned char, unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:385: undefined reference to `MPU6050::resetI2CMaster()'

sketch/MPU6050_6Axis_MotionApps20.h:392: undefined reference to `MPU6050::writeProgMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:399: undefined reference to `MPU6050::writeProgDMPConfigurationSet(unsigned char const*, unsigned int)'

sketch/MPU6050_6Axis_MotionApps20.h:403: undefined reference to `MPU6050::setClockSource(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:406: undefined reference to `MPU6050::setIntEnabled(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:409: undefined reference to `MPU6050::setRate(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:412: undefined reference to `MPU6050::setExternalFrameSync(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:415: undefined reference to `MPU6050::setDLPFMode(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:418: undefined reference to `MPU6050::setFullScaleGyroRange(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:422: undefined reference to `MPU6050::setDMPConfig1(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:424: undefined reference to `MPU6050::setDMPConfig2(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:427: undefined reference to `MPU6050::setOTPBankValid(bool)'

sketch/MPU6050_6Axis_MotionApps20.h:430: undefined reference to `MPU6050::setXGyroOffsetTC(signed char)'

sketch/MPU6050_6Axis_MotionApps20.h:431: undefined reference to `MPU6050::setYGyroOffsetTC(signed char)'

sketch/MPU6050_6Axis_MotionApps20.h:432: undefined reference to `MPU6050::setZGyroOffsetTC(signed char)'

sketch/MPU6050_6Axis_MotionApps20.h:443: undefined reference to `MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:447: undefined reference to `MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:450: undefined reference to `MPU6050::resetFIFO()'

sketch/MPU6050_6Axis_MotionApps20.h:453: undefined reference to `MPU6050::getFIFOCount()'

sketch/MPU6050_6Axis_MotionApps20.h:458: undefined reference to `MPU6050::getFIFOBytes(unsigned char*, unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:461: undefined reference to `MPU6050::setMotionDetectionThreshold(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:464: undefined reference to `MPU6050::setZeroMotionDetectionThreshold(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:467: undefined reference to `MPU6050::setMotionDetectionDuration(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:470: undefined reference to `MPU6050::setZeroMotionDetectionDuration(unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:473: undefined reference to `MPU6050::resetFIFO()'

sketch/MPU6050_6Axis_MotionApps20.h:476: undefined reference to `MPU6050::setFIFOEnabled(bool)'

sketch/MPU6050_6Axis_MotionApps20.h:479: undefined reference to `MPU6050::setDMPEnabled(bool)'

sketch/MPU6050_6Axis_MotionApps20.h:482: undefined reference to `MPU6050::resetDMP()'

sketch/MPU6050_6Axis_MotionApps20.h:486: undefined reference to `MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:490: undefined reference to `MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:494: undefined reference to `MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:497: undefined reference to `MPU6050::getFIFOCount()'

sketch/MPU6050_6Axis_MotionApps20.h:502: undefined reference to `MPU6050::getFIFOBytes(unsigned char*, unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:511: undefined reference to `MPU6050::readMemoryBlock(unsigned char*, unsigned int, unsigned char, unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:514: undefined reference to `MPU6050::getFIFOCount()'

sketch/MPU6050_6Axis_MotionApps20.h:520: undefined reference to `MPU6050::getFIFOBytes(unsigned char*, unsigned char)'

sketch/MPU6050_6Axis_MotionApps20.h:529: undefined reference to `MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)'

sketch/MPU6050_6Axis_MotionApps20.h:534: undefined reference to `MPU6050::setDMPEnabled(bool)'

sketch/MPU6050_6Axis_MotionApps20.h:543: undefined reference to `MPU6050::resetFIFO()'

sketch/MPU6050_6Axis_MotionApps20.h:544: undefined reference to `MPU6050::getIntStatus()'

C:\Users\MALHAR~1\AppData\Local\Temp\cchG4dmd.ltrans0.ltrans.o: In function `setup':

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:63: undefined reference to `MPU6050::setXGyroOffset(int)'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:64: undefined reference to `MPU6050::setYGyroOffset(int)'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:65: undefined reference to `MPU6050::setZGyroOffset(int)'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:66: undefined reference to `MPU6050::setZAccelOffset(int)'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:73: undefined reference to `MPU6050::setDMPEnabled(bool)'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:78: undefined reference to `MPU6050::getIntStatus()'

C:\Users\MALHAR~1\AppData\Local\Temp\cchG4dmd.ltrans0.ltrans.o: In function `loop':

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:146: undefined reference to `MPU6050::getIntStatus()'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:149: undefined reference to `MPU6050::getFIFOCount()'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:155: undefined reference to `MPU6050::resetFIFO()'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:163: undefined reference to `MPU6050::getFIFOCount()'

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:166: undefined reference to `MPU6050::getFIFOBytes(unsigned char*, unsigned char)'

C:\Users\MALHAR~1\AppData\Local\Temp\cchG4dmd.ltrans1.ltrans.o: In function `__static_initialization_and_destruction_0':

C:\Users\Malhar Wable\Documents\Arduino\Sketch 1\sketch_1/sketch_1.ino:11: undefined reference to `MPU6050::MPU6050(unsigned char)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

Put this at the top of your sketch...

#include <MPU6050.h>

...and don't do this2 * 16384

@coding badly
I tried adding the <MPU6050.h> file but it still shows the error. Im new to this and unable to find a way out.

It looks like you installed the .h file, but not the .cpp file.

It seems like you're doing something odd. Usually we install libraries to the libraries folder but you seem to be attempting to install the library right into your sketch. That is possible, but it usually just makes things more complicated.

Maybe it would be useful if you described what you're attempting to do.

@pert
I am trying to build a self balancing unicycle using a hub motor, arduino uno, mpu6050 and the jyqd QS 909 motor controller, but I am unable to find the right codes for it. Pl. help me into this I am really unable to find anything useful.

Interesting sounding project but it is not very likely that you'll just find exactly the right code for your choice of components. You're going to have to do some work.

So to help we really need to see the code that you are trying to compile. There is not much point us just trying to guess what you have.

Steve

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Does the library MPU6050, appear in the examples list in the IDE?

Thanks.. Tom.. :slight_smile: