bolderflight / invensense-imu

Arduino and CMake library for communicating with the InvenSense MPU-6500, MPU-9250 and MPU-9255 nine-axis IMUs.
MIT License
497 stars 210 forks source link

Incompatible with AVR architecture ? #115

Closed sterretjeToo closed 1 year ago

sterretjeToo commented 1 year ago

The following error message shows when compiling the i2c or drdy_spy examples when compiling for the Arduino Mega.

In file included from C:\Users\sterretje\AppData\Local\Temp\.arduinoIDE-unsaved202297-20044-3fuz8n.md4do\i2c\i2c.ino:26:0:
c:\Users\sterretje\Documents\Arduino\libraries\Bolder_Flight_Systems_MPU9250\src/mpu9250.h:36:10: fatal error: cstddef: No such file or directory
 #include <cstddef>
          ^~~~~~~~~
compilation terminated.

The above was error occured when using IDE2.0; I've also tried using portable installs of 1.8.19 and 1.6.6.

Trying to compile was triggered by the following topic on forum.arduino.cc https://forum.arduino.cc/t/i-am-trying-to-connect-mpu9250-with-my-arduino-uno-and-i-am-getting-this-error-while-uploading-the-code/982106

According to https://www.arduino.cc/reference/en/libraries/bolder-flight-systems-mpu9250/, the library is compatible with ALL architectures. But cstddef never seems to have been part of the AVR architecture according to https://github.com/arduino/Arduino/issues/5209

Regards, sterretje

jetsup commented 1 year ago

I have encountered the same problem. I used the locate command and the cstddef library is in my system, but I still can't figure out why it can't be loaded.

flybrianfly commented 1 year ago

@sterretjeToo @jetsup, v6 and newer of this library supports AVR and should work out of the box. Please download directly from GitHub, the Arduino Library manager does a poor job of grabbing library updates. Let me know if this doesn't work, we specifically developed and tested that version against AVR.

@jetsup, it doesn't matter if cstddef is on your system, the AVR compiler cannot use it.

jetsup commented 1 year ago

V6.0.2 worked for me... Okay @flybrianfly, I thought it did depend on it. Thank you.