platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
330 stars 219 forks source link

Project working on Arduino IDE fails to build in PIO #227

Open pfeerick opened 4 years ago

pfeerick commented 4 years ago

In the process of porting a project written by someone else from Arduino IDE to PlatformIO, and hit a snag with

UdpContext.h:539:34: error: 'DEBUGV' was not declared in this scope

The project is on GitLab (platformio branch), and I set up a runner to do CI builds for this, which gives the same error as my own desktop (on Windows). Latest version of the Arduino IDE with the same platform and library versions (i.e. all latest versions) (edit:) does NOT result in the same error . Runner log and the Arduino IDE verbose log are attached in the issue linked to the CI failure: https://gitlab.com/pfeerick/mrdiy-audio-notifier/-/issues/1 . As I mention in that issue, adding

#ifndef DEBUGV
#define DEBUGV(...) do { (void)0; } while (0)
#endif

to a framework core file - %userprofile%\.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi\src\include\UdpContext.h - resolves it... so is it something I've missed/broken, or is there a PIO incompatibility here?

Edit: just realised that I said the Arduino IDE had the same compile error, when in fact that is not the case. The Arduino IDE did not have any compile issues.

max5555 commented 3 years ago

I have the same problem and your solution helped.

pfeerick commented 3 years ago

Thanks for the feedback. Was it for the same project - mrdiy-audio-notifier? As if it isn't, it would be interesting to know what it is, so we can see where else it has failed. I haven't tried to compile this again since, so I don't know if anything else has changed in the meantime.

EtienneTetreault commented 3 years ago

Same problem here and the solution (define DEBUGV in UdpContext.h) seems to works. I did use it for the mrdiy-audio-notifier project. On another note, for the same project, I had to declare #include #include <SD.h> in the main.cpp to ensure the ESP8266Audio librairy would find it. I dont think it is related though.

pfeerick commented 3 years ago

In order to work around this for now, since I'm revisiting the project again, I used an extra_script to apply this workaround if not already applied. You can see the what I did here. It's nothing fancy, and is basically a copy of the how to override a package file example from the docs, and seems to work fine for Windows and Linux (CI linux runner was fine, and on Windows I have git installed).

razdavidovich commented 3 years ago

Since this issue is still open, for me the issue started after I installed the RemoteDebug library (https://github.com/JoaoLopesF/RemoteDebug) which have a debugV function. The workaround from @pfeerick worked for me, but I think this require an official fix.