Adding libraries for Adafruit bno055

Hello all,

I am new to Arduino. I have a Adafruit bno055 orientation sensor which I want to include in my existing project. I included the sensor drivers using cmake.
The drivers:

Upon compiling, I get the following error:

/src/ext/drivers/imu/adafruit/bno055/arduino/WProgram.h:10:32: fatal error: core_build_options.h: No such file or directory
 #include "core_build_options.h"
compilation terminated.

I searched the drivers for the required header file but I couldn't find it. There are many similar header files missing.

Do I need to download more libraries? If yes, which ones?

P.S: I did post a similar question but on a different board. include Adafruit BNO055 libraries in Qt project using CMake

WProgram.h indicates you're using some extremely outdated code. The easiest solution is to forget about CMake and just use the Arduino IDE. If you don't like the IDE's GUI, you can use the CLI:

You can also use arduino-cli, but you should be aware it's still in beta:

I'm sure you can get the CMake system working with enough effort but I don't think it's worth using if it means you're stuck back in 2010. To make it actually useful, you'll need to figure out how to make it work with modern code.


Thank you for the response. The Adafruit sensor is an extension to my existing project. My entire project built in Qt using CMake. The project has several modules. Hence, it would be simpler for me to include the sensor drivers in my current project rather than shift the entire project to Arduino IDE.
Are there some examples that I can refer to for this issue? I tried to search online but I couldn't find any.
I did find some libraries here: Arduino Tiny
But they also seem to be outdated.

The problem is not with the libraries. What is the story with this file?:
How did it get there?

I did find some libraries here: Arduino Tiny
But they also seem to be outdated.

That is a hardware package to add support for the ATtiny microcontrollers to the Arduino IDE. It is only useful if you're using an ATtiny microcontroller in your project. I do think it's also a bit outdated (being on Google Code is a good indication). I do seem to remember using a newer version of that project that was hosted on GitHub but that was some years ago so I might be thinking of another project. I've been using the more actively maintained ATTinyCore exclusively for my ATtiny microcontrollers recently but I'm sure that Tiny project was well done.

The WProgram.h is present in the bno055 driver. Adafruit_BNO055/Adafruit_BNO055.h at master · adafruit/Adafruit_BNO055 · GitHub
The header file Adafruit_BNO055 has the following

#ifndef __ADAFRUIT_BNO055_H__
#define __ADAFRUIT_BNO055_H__

#if (ARDUINO >= 100)
 #include "Arduino.h"
#include "WProgram.h"                           //inclusion of the file.

#ifdef __AVR_ATtiny85__
 #include <TinyWireM.h>
 #define Wire TinyWireM
 #include <Wire.h>

The driver also has an abstraction class: Adafruit_Sensor/Adafruit_Sensor.h at master · adafruit/Adafruit_Sensor · GitHub
It contains the same header file


#ifndef ARDUINO
 #include <stdint.h>
#elif ARDUINO >= 100
 #include "Arduino.h"
 #include "Print.h"
 #include "WProgram.h"

The driver files are 3 years old. But there are no new driver files for the sensor.

The WProgram.h is present in the bno055 driver.

Wrong. The #include directive for that file is present in the Adafruit_BNO055 library, but that file is NOT present in the library. So I'll ask again: What is the story with this file?:

The reason for the #include directive for WProgram.h is to provide support for the >7 years old pre-1.0.0 Arduino IDE versions. In Arduino IDE 1.0.0 and later, the filename was changed to Arduino.h. The ARDUINO macro is set according to the Arduino IDE version. So this code automatically selects the correct header filename according to the IDE version. If you have not defined ARDUINO, then it will attempt to use WProgram.h instead of Arduino.h.

Thank you for the tip. I tried to include the same header files in the Arduino IDE version 1.8.7 and it worked.
For the Qt project, I have not defined the Arduino version in my Cmake File. Hence it uses WProgram.h and gives me an error. So I need to include this in the CmakeLists.txt. Are there any examples of including Arduino Libraries using Cmake?

There are some projects that try to make it easy to use CMake with Arduino projects. I have never used these but I have had some minor interactions with the development process that lead me to give them a brief look. This one:

seems to have been abandoned and then development moved here:

I believe there are some other similar projects.