I'm trying to compile an Arduino lib I'm writing under Eclipse. This is the basic sketch sx.cpp
I'm using, it compiles using standard Arduino IDE 1.8.0:
#include <Arduino.h>
#include <vector>
void setup() {
}
void loop() {
std::vector<byte> a(0x22);
}
This is the compiler out:
Building sx
"C:/Users/Ale/Documents/Arduino/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10608 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"C:/Users/Ale/Documents/Arduino/packages/arduino/hardware/avr/1.6.21/cores/arduino" -I"C:/Users/Ale/Documents/Arduino/packages/arduino/hardware/avr/1.6.21/variants/standard" "../../sx.cpp" -o "project/sx.cpp.o"
../../sx.cpp:3:18: fatal error: vector: No such file or directory
#include <vector>
^
compilation terminated.
make: *** [project/sx.cpp.o] Error 1
makefile:67: recipe for target 'project/sx.cpp.o' failed
I'm using Eclipse 4.8.0 and Arduino project nature (CDT core compiler), but I'm not interested in uploading to real boards and/or debugging. Without vector a
and relevant #include of course it compiles.
(EDIT) The longer story:
I have been writing this lib for like 5 days with text editors. I come from Java development, so please be patient. My lib uses some c++ standard classes, std::vector among a couple other. Everything was OK using Arduino IDE, but after 5 days it's way unpractical for me, so I decided to re-try Arduino with Eclipse after 5 years (my first eclipse-cdt experience was awful and complex). With newest Photon release, I noticed the 'Arduino' template project and the Arduino lib manager included "out-of-the-box", so I decided to give it a try.
I'm actually using an ESP32 board but again, I'm not interested in uploading/executing the code. I just need to be able to refactor it handly