platform-espressif8266 icon indicating copy to clipboard operation
platform-espressif8266 copied to clipboard

Project working on Arduino IDE fails to build in PIO

Open pfeerick opened this issue 5 years ago • 5 comments

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.

pfeerick avatar Aug 31 '20 09:08 pfeerick

I have the same problem and your solution helped.

max5555 avatar Oct 11 '20 15:10 max5555

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.

pfeerick avatar Oct 16 '20 07:10 pfeerick

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.

EtienneTetreault avatar Nov 05 '20 16:11 EtienneTetreault

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).

pfeerick avatar Nov 23 '20 08:11 pfeerick

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.

razdavidovich avatar Aug 27 '21 22:08 razdavidovich