I have a project that has been working fine for months/years, and now all of a sudden I'm seeing an error similar to
(.text.startup+0x7f6): undefined reference to MPU6050::initialize()
For every reference to my MPU6050 object in the code. In the code itself, intellisense correctly colors and highlights all such references, the flyover text is correct, and selecting 'Peek/GoTo Definition goes to the correct implementation file and section.
Any ideas?
Code file attached (too large to place inline)
ccKHFIlK.ltrans0.ltrans.o*: In function main
(.text.startup+0x7f6): undefined reference to MPU6050::initialize()
(.text.startup+0x806): undefined reference to MPU6050::testConnection()
(.text.startup+0x828): undefined reference to MPU6050::reset()
(.text.startup+0x83e): undefined reference to MPU6050::setSleepEnabled(bool)
(.text.startup+0x84c): undefined reference to MPU6050::setMemoryBank(unsigned char, bool, bool)
(.text.startup+0x856): undefined reference to MPU6050::setMemoryStartAddress(unsigned char)
(.text.startup+0x864): undefined reference to MPU6050::setMemoryBank(unsigned char, bool, bool)
(.text.startup+0x86c): undefined reference to MPU6050::getXGyroOffsetTC()
(.text.startup+0x876): undefined reference to MPU6050::getYGyroOffsetTC()
(.text.startup+0x880): undefined reference to MPU6050::getZGyroOffsetTC()
(.text.startup+0x88e): undefined reference to MPU6050::setSlaveAddress(unsigned char, unsigned char)
(.text.startup+0x898): undefined reference to MPU6050::setI2CMasterModeEnabled(bool)
(.text.startup+0x8a4): undefined reference to MPU6050::setSlaveAddress(unsigned char, unsigned char)
(.text.startup+0x8ac): undefined reference to MPU6050::resetI2CMaster()
(.text.startup+0x8d0): undefined reference to MPU6050::writeProgMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool)
(.text.startup+0x8e6): undefined reference to MPU6050::writeProgDMPConfigurationSet(unsigned char const*, unsigned int)
(.text.startup+0x8f6): undefined reference to MPU6050::setClockSource(unsigned char)
(.text.startup+0x900): undefined reference to MPU6050::setIntEnabled(unsigned char)
(.text.startup+0x90a): undefined reference to MPU6050::setRate(unsigned char)
(.text.startup+0x914): undefined reference to MPU6050::setExternalFrameSync(unsigned char)
(.text.startup+0x91e): undefined reference to MPU6050::setDLPFMode(unsigned char)
(.text.startup+0x928): undefined reference to MPU6050::setFullScaleGyroRange(unsigned char)
(.text.startup+0x932): undefined reference to MPU6050::setDMPConfig1(unsigned char)
(.text.startup+0x93c): undefined reference to MPU6050::setDMPConfig2(unsigned char)
(.text.startup+0x946): undefined reference to MPU6050::setOTPBankValid(bool)
(.text.startup+0x950): undefined reference to MPU6050::setXGyroOffsetTC(signed char)
Error linking for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)
(.text.startup+0x95a): undefined reference to MPU6050::setYGyroOffsetTC(signed char)
(.text.startup+0x964): undefined reference to MPU6050::setZGyroOffsetTC(signed char)
Build failed for project 'FourWD_WallE2_V3'
(.text.startup+0x9bc): undefined reference to MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)
(.text.startup+0xa08): undefined reference to MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)
(.text.startup+0xa10): undefined reference to MPU6050::resetFIFO()
(.text.startup+0xa18): undefined reference to MPU6050::getFIFOCount()
(.text.startup+0xa24): undefined reference to MPU6050::getFIFOBytes(unsigned char*, unsigned char)
(.text.startup+0xa2e): undefined reference to MPU6050::setMotionDetectionThreshold(unsigned char)
(.text.startup+0xa38): undefined reference to MPU6050::setZeroMotionDetectionThreshold(unsigned char)
(.text.startup+0xa42): undefined reference to MPU6050::setMotionDetectionDuration(unsigned char)
(.text.startup+0xa4c): undefined reference to MPU6050::setZeroMotionDetectionDuration(unsigned char)
(.text.startup+0xa54): undefined reference to MPU6050::resetFIFO()
(.text.startup+0xa5e): undefined reference to MPU6050::setFIFOEnabled(bool)
(.text.startup+0xa68): undefined reference to MPU6050::setDMPEnabled(bool)
(.text.startup+0xa70): undefined reference to MPU6050::resetDMP()
(.text.startup+0xabc): undefined reference to MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)
(.text.startup+0xb08): undefined reference to MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)
(.text.startup+0xb54): undefined reference to MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)
(.text.startup+0xb5c): undefined reference to MPU6050::getFIFOCount()
(.text.startup+0xb6e): undefined reference to MPU6050::getFIFOBytes(unsigned char*, unsigned char)
(.text.startup+0xbb4): undefined reference to MPU6050::readMemoryBlock(unsigned char*, unsigned int, unsigned char, unsigned char)
(.text.startup+0xbbc): undefined reference to MPU6050::getFIFOCount()
(.text.startup+0xbce): undefined reference to MPU6050::getFIFOBytes(unsigned char*, unsigned char)
(.text.startup+0xc1c): undefined reference to MPU6050::writeMemoryBlock(unsigned char const*, unsigned int, unsigned char, unsigned char, bool, bool)
(.text.startup+0xc26): undefined reference to MPU6050::setDMPEnabled(bool)
(.text.startup+0xc3a): undefined reference to MPU6050::resetFIFO()
(.text.startup+0xc42): undefined reference to MPU6050::getIntStatus()
(.text.startup+0xc66): undefined reference to MPU6050::setDMPEnabled(bool)
(.text.startup+0xca8): undefined reference to MPU6050::getIntStatus()
ccKHFIlK.ltrans2.ltrans.o*: In function global constructors keyed to 65535_0_FourWD_WallE2_V3.cpp.o.3870
(.text.startup+0x188): undefined reference to MPU6050::MPU6050(unsigned char)
collect2.exe*: error: ld returned 1 exit status
Frank