probonopd / WirelessPrinting

Print wirelessly from Cura, PrusaSlicer or Slic3r to your 3D printer connected to an ESP8266 or ESP32 module
352 stars 65 forks source link

Compile Error: redefinition of 'class fs::File' #141

Closed cpeuschel closed 4 years ago

cpeuschel commented 4 years ago

Hi, while compiling i got some error:

..src/FatLib/ArduinoFiles.h:122:7: error: redefinition of 'class fs::File' class File : public FatFile, public Stream { ^

probonopd commented 4 years ago

Hi, did you install the exact same combination of versions and commits as we are using in the Travis CI build? Which operating system are you on?

cc @TheAssassin these kinds of things make me wonder whether it would be a good idea to switch to PlatformIO...

TheAssassin commented 4 years ago

It always makes sense. The platformio definitions are written very quickly, and they have the advantage that you can predefine everything you need (e.g., board definitions). Upload settings can always be altered by the user. You can also provide multiple environments that all use the same board but use e.g., different upload ports or speeds (e.g., one for USB/serial, one for OTA updating).

cpeuschel commented 4 years ago

Hi, im using MacOs with Arduino IDE. Maybe i got the error because im using the NodeMCU Board and not the D1 mini? But if i burn your release bin (ESP8266WirelessPrintAsync_d1_mini_bad8e51.bin) on the NodeMCU it works fine on my printer.

If i using Linux with the configuration in the travis ci i got follow error: /root/Arduino/libraries/AsyncElegantOTA/src/AsyncElegantOTA.h:51:71: error: 'U_FS' was not declared in this scope int cmd = (filename.indexOf("spiffs") > -1) ? U_FS : U_FLASH;

cpeuschel commented 4 years ago

Hi, with Version 1.0.6 of AsyncElegantOTA i got the error "error: 'U_FS' was not declared" if i downgrade the Version to 1.0.4 (git clone https://github.com/ayushsharma82/AsyncElegantOTA ; cd AsyncElegantOTA ; git reset --hard 5c42ca2 ) then the compiling success. Can you reproduce that?

probonopd commented 4 years ago

Argh, typical Arduino version hell. I had to do a lot of experimentation until I had found the exact combination of versions and hashes that works for me. All I can say is that the exact build configuration in .travis.yml works for me (and I am really hesitant to touch it).

TheAssassin commented 4 years ago

@probonopd you should really prefer to use platformio instead of this Arduino IDE CLI compilation hell. With platformio, there's a very straightforward way to use libraries with specific versions. You can pin dependencies to repository tags or single commits, whatever is required.

TheAssassin commented 4 years ago

@cpeuschel I could reproduce your issue perfectly while creating #144. I've pinned a few more libraries and frameworks to static versions and it builds perfectly now with platformio. Hopefully will be merged soon-ish.

cpeuschel commented 4 years ago

@TheAssassin Build (nodemcuv2) was successful with vscode :) Flash esp8266 with this command

esptool.py write_flash -fm qio 0x00000 firmware.bin

probonopd commented 4 years ago

Thanks @TheAssassin you have made at least 2 people happy today