Bug? ESP8266WiFi + MFRC522 error

Discussion in 'B4R Bugs & Wishlist' started by ilpesce, Feb 2, 2017.

  1. ilpesce

    ilpesce Member Licensed User

    Hello and thanks in advance to all
    I'm trying to use the libraries "rESP8266WiFi and "rMFRC522" along with an ESP-12E module device.
    if you use rESP8266WiFi is ok
    if you use rMFRC522 is ok
    if you use rESP8266WiFi + rMFRC522 is compilation error ...
    it is sufficient to enter the libraries, even without code

    error
    -------------------------------------------------------------------
    B4R version: 1.80
    Parsing code. (0.02s)
    Compiling code. (0.11s)
    Building project (0.03s)
    Compiling & deploying Ino project (NodeMCU 1.0 (ESP-12E Module) - COM7) Error
    Sto caricando la configurazione...
    Sto inizializzando i pacchetti...
    Sto preparando le schede...
    Sto verificando...
    sketch\rMFRC522.cpp: In member function 'bool B4R::B4MFRC522::MifareWrite(Byte, B4R::ArrayByte*)':
    rMFRC522.cpp:44: error: 'min' was not declared in this scope
    return (rfid.MIFARE_Write(BlockAddress, (Byte*)Buffer->data, min(16, Buffer->length))) == MFRC522::STATUS_OK;
    ^
    sketch\rMFRC522.cpp:44:86: note: suggested alternative:
    In file included from c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\char_traits.h:39:0,
    from c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\string:40,
    from c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\stdexcept:39,
    from c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\array:38,
    from c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\tuple:39,
    from c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\functional:55,
    from C:\Users\ilpesce\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27,
    from C:\Users\ilpesce\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28,
    from C:\Users\ilpesce\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
    from sketch\rESP8266WiFi.h:6,
    from sketch\B4RDefines.h:25,
    from sketch\rMFRC522.cpp:2:
    c:\users\ilpesce\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: 'std::min'
    min(const _Tp& __a, const _Tp& __b, _Compare __comp)
    ^
    exit status 1
    --------------------------------------------------------------------------

    it happened to someone else?
    Best regards
     
    Last edited: Feb 2, 2017
  2. Erel

    Erel Administrator Staff Member Licensed User

    I've tried it with this code and it compiles successfully:
    Code:
    Sub Process_Globals
       
    Public Serial1 As Serial
       
    Private wifi As ESP8266WiFi
       
    Private mfr As MFRC522
    End Sub

    Private Sub AppStart
       Serial1.Initialize(
    115200)
       
    Log("AppStart")
    End Sub
     
  3. Erel

    Erel Administrator Staff Member Licensed User

  4. ilpesce

    ilpesce Member Licensed User

    Thanks Erel my appreciation for you is always very large
    Best regards
     
    Last edited: Feb 3, 2017
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice