Closed treii28 closed 6 years ago
@treii28 will take a look soon
@vshymanskyy Grrr, nevermind. It was my mistake. I had initially copied the ino file and I usually rename it to the main.cpp before compiling but apparently just copied it this time so the ino was still in the directory. stupid stupid stupid
Blynk library version: [...] 0.5.3
IDE: [Arduino/Energia/MBED Compiler/Platform.IO/Eclipse ...] Platform.IO
IDE version: [...] 3.5.3
Board type: [...] esp32dev
Scenario, steps to reproduce
init new project using:
> pio init --board esp32dev --ide clion
modified Esp32 SSL example to include Arduino.h, renamed to src/main.cpp
Execute 'run' to compile firmware:
> pio run
[What you are trying to achieve and you can't?] compile firmware
Expected Result
Success
Actual Result
Series of 'multiple definition' errors
Generally when I have run into this, it can be gotten around by wrapping the various 'Include' lines with compiler directives to check first if the library has already been included by the platformio compiler. e.g. when I add the arduino header in main.cpp I do it as:
Similarly if I get a source package set up for the Arduino IDE that isn't optimized for other compiling methods, if I go into the header files for the package and similarly add the symbols defined for each in a simlar ifndef test surrounding all #include lines, I no longer get attempts to re-define constants or functions.
So, for example, in the SSL example code where it includes it's needed libraries I modify those includes as follows:
If I still get the errors, I then similarly modify the headers in the library themselves until the errors cease.