My team started to implement some messy code from an older team (dogs)
but the compiler throws an error when ever a Header out side of the “lib” folder should be included.
Because of that we moved libaries from lib_deps to the “lib” folder but I’m growing tired now that even some Arduino libaries aren’t found.
Error msg when compiling
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (5.0.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy @ 1.159.0 (1.59)
- tool-teensy @ 1.159.0 (1.59)
- toolchain-gccarmnoneeabi-teensy @ 1.110301.0 (11.3.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 126 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit BNO055 @ 1.6.3
|-- Adafruit BusIO @ 1.16.1
|-- Adafruit ILI9341 @ 1.6.1
|-- Adafruit TSC2007 @ 1.1.2
|-- TCA9534 @ 0.1.1
|-- Adafruit NeoPixel @ 1.12.3
|-- Adafruit TCS34725 @ 1.4.4
|-- Adafruit_VL6180X @ 1.4.3
|-- General
|-- Timer
Building in release mode
Compiling .pio\build\teensy40\src\main.cpp.o
Compiling .pio\build\teensy40\libb94\Camera\Camera.cpp.o
Compiling .pio\build\teensy40\lib7e2\Movement\Movement.cpp.o
Compiling .pio\build\teensy40\libff8\General\General.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial3.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial4.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial5.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial6.cpp.o
In file included from lib\Camera\../DogLib/../General/..\Movement\../Adafruit BNO055/Adafruit_BNO055.h:28,
from lib\Camera\../DogLib/../General/..\Movement\Movement.h:6,
from lib\Camera\../DogLib/../General/General.h:12,
from lib\Camera\../DogLib/VarsFromDogs.h:4,
from lib\Camera\Camera.h:5,
from lib\Camera\Camera.cpp:1:
c:\users\lesee\documents\rag\maze-milbe-test\lib\adafruit busio@1.16.1\adafruit_i2cdevice.h:5:10: fatal error: Wire.h: No such file or directory
**************************************************************
* Looking for Wire.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:Wire.h"
* Web > https://registry.platformio.org/search?q=header:Wire.h
*
**************************************************************
5 | #include <Wire.h>
| ^~~~~~~~
compilation terminated.
*** [.pio\build\teensy40\libb94\Camera\Camera.cpp.o] Error 1
In file included from lib\Movement\../DogLib/VarsFromDogs.h:4,
from lib\Movement\Movement.h:8,
from lib\Movement\Movement.cpp:1:
lib\Movement\../DogLib/../General/General.h:42:5: error: 'Movement' does not name a type; did you mean 'Movement_h'?
42 | Movement move; //Movement libary
| ^~~~~~~~
| Movement_h
*** [.pio\build\teensy40\lib7e2\Movement\Movement.cpp.o] Error 1
In file included from C:\Users\lesee\.platformio\packages\framework-arduinoteensy\cores\teensy4/WProgram.h:46,
from C:\Users\lesee\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6,
from lib\General\../ILI9341_t3n/ILI9341_t3n.h:101,
from lib\General\General.h:7,
from lib\General\General.cpp:1:
C:\Users\lesee\.platformio\packages\framework-arduinoteensy\cores\teensy4/wiring.h: In instantiation of 'constexpr decltype (((a < b) ? forward<A>(a) : forward<B>(b))) max(A&&, B&&) [with A = int; B = unsigned int; decltype (((a < b) ? forward<A>(a) : forward<B>(b))) = unsigned int]':
lib\General\General.cpp:133:28: required from here
C:\Users\lesee\.platformio\packages\framework-arduinoteensy\cores\teensy4/wiring.h:120:12: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
120 | return a >= b ? std::forward<A>(a) : std::forward<B>(b);
| ~~^~~~
============================================================================================================ [FAILED] Took 7.55 seconds ============================================================================================================
* The terminal process "C:\Users\lesee\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'teensy40'" terminated with exit code: 1.
(The error within Wire.h doesn’t always pop up only sometimes and it always only throws an error for 1-2 “missing” Headers)
platformio.ini
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
lib_deps =
Adafruit/Adafruit BNO055 @ 1.6.3
Adafruit/Adafruit BusIO @ 1.16.1
Adafruit/Adafruit ILI9341 @ 1.6.1
Adafruit/Adafruit TSC2007 @ 1.1.2
hideakitai/TCA9534 @ 0.1.1
Adafruit/Adafruit NeoPixel @ 1.12.3
adafruit/Adafruit TCS34725@^1.4.4
Adafruit/Adafruit_VL6180X @ 1.4.3
I tried including them with relativ paths to the lib_deps folder and tried using “” and <>.
I’ve seen others on this forum have this problem but nothing fixes it.
The whole project would be to large but here are the essential files:
main.cpp
#include <Arduino.h>
#include "../lib/General/General.h"
#include "../lib/Timer/timer.h"
/*
---------------------------------------------------------
----------------------Main-------------------------------
---------------------------------------------------------
*/
int main()
{
/*
I cut the main code for this post 'cause it hundreds of lines
*/
while(true){
}
}
General.h
#ifndef General_h
#define General_h
//Defines & Enums
#include "DefineEnum.h"
//Display
#include "../ILI9341_t3n/ILI9341_t3n.h"
//Expander
#include "../TCA9534/TCA9534.h"
//Motors
#include "..\Motor\Motor.h"
#include "..\Movement\Movement.h"
//BNO
#include <Adafruit_BNO055.h>
//TOF
#include "../TOF/TOF.h"
//LED
#include "..\Adafruit_Neopixel\Adafruit_Neopixel.h"
//Servo
#include "../Servo/Servo.h"
//Colorsensor
#include "../ColorSensor/ColorSensor.h"
//Camera
#include "../Camera/Camera.h"
class Robot{
public:
/*
I cut everything again
*/
~Robot(){ //Destructor of the class
};
Robot();
private:
};
#endif
The BusIO libary wasn’t edited and was copied from lib_deps like every other
(Only for some others we changed the include path so they were correct after coping the includes to “lib”)