B4R Question NodeMCU + SSD1306 Display - Won't compile.

Mark Read

Well-Known Member
Licensed User
Longtime User
I have downloaded the files from https://www.b4x.com/android/forum/threads/radafruitssd1306-oled-displays.68906/#content and also the GFX files. I am using the same display as Erel but with a NodeMCU. I have tried the Clock example and it runs fine without any problems but my program will not compile and I cannot see the error.

B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 600
#End Region
'Ctrl+Click to open the C code folder: ide://run?File=%WINDIR%\System32\explorer.exe&Args=%PROJECT%\Objects\Src

Sub Process_Globals
    Public Serial1 As Serial
    Public WiFi As ESP8266WiFi
    Public Udp As WiFiUDP
    Public WifiSSID As String="xxx"
    Public WifiPass As String="xxx"
    Private ssd As AdafruitSSD1306
    Private d1pins As D1Pins
    
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    If WiFi.IsConnected=False Then
        ConnectToNetwork
    End If
   ' Udp.Initialize(8888,"UDP_PacketArrived")
    ssd.InitializeI2C(d1pins.D6, 0x3c)
    ssd.ClearDisplay
    ssd.GFX.SetCursor(0, 0)
    ssd.GFX.ConfigureText(1, ssd.WHITE, False)
    ssd.GFX.DrawText("Waiting ...").DrawText(CRLF).DrawText(CRLF)
    ssd.GFX.DrawText("No UDP Data")
    ssd.Display
End Sub

Sub ConnectToNetwork
    If WiFi.IsConnected Then
        Return
    End If
    If WiFi.Connect2(WifiSSID, WifiPass) Then
        Log("Connected successfully to: ", WifiSSID)
        Log(WiFi.LocalIp)
    Else
        Log("Failed to connect.")
    End If
End Sub

1617961828837.png


The Error:

"E:\\Arduino-1.8.13\\portable\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/include" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/lwip2/include" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/libc/xtensa-lx106-elf/include" "-IE:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\cores\\esp8266" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\variants\\nodemcu" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\SPI" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\ESP8266WiFi\\src" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\Wire" "E:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin\\sketch\\B4RCore.cpp" -o "E:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin\\sketch\\B4RCore.cpp.o"
"E:\\Arduino-1.8.13\\portable\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/include" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/lwip2/include" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/libc/xtensa-lx106-elf/include" "-IE:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\cores\\esp8266" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\variants\\nodemcu" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\SPI" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\ESP8266WiFi\\src" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\Wire" "E:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin\\sketch\\B4RCore.cpp" -o "E:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin\\sketch\\B4RCore.cpp.o"
"E:\\Arduino-1.8.13\\portable\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/include" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/lwip2/include" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4/tools/sdk/libc/xtensa-lx106-elf/include" "-IE:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\cores\\esp8266" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\variants\\nodemcu" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\SPI" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\ESP8266WiFi\\src" "-IE:\\Arduino-1.8.13\\portable\\packages\\esp8266\\hardware\\esp8266\\2.7.4\\libraries\\Wire" "E:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin\\sketch\\B4RCore.cpp" -o "E:\\BASIC4~3\\Projects\\UDPREC~1\\Objects\\bin\\sketch\\B4RCore.cpp.o"
In file included from E:\BASIC4~3\Projects\UDPREC~1\Objects\bin\sketch\B4RDefines.h:24:0,
from E:\BASIC4~3\Projects\UDPREC~1\Objects\bin\sketch\B4RCore.cpp:1:
rAdafruitGFX.h:13:18: error: 'Int' has not been declared
void DrawLine(Int X0, Int Y0, Int X1, Int Y1, UInt Color);
^
rAdafruitGFX.h:13:26: error: 'Int' has not been declared
void DrawLine(Int X0, Int Y0, Int X1, Int Y1, UInt Color);
^
rAdafruitGFX.h:13:34: error: 'Int' has not been declared
void DrawLine(Int X0, Int Y0, Int X1, Int Y1, UInt Color);
^
rAdafruitGFX.h:13:42: error: 'Int' has not been declared
void DrawLine(Int X0, Int Y0, Int X1, Int Y1, UInt Color);
^
rAdafruitGFX.h:13:50: error: 'UInt' has not been declared
void DrawLine(Int X0, Int Y0, Int X1, Int Y1, UInt Color);
^
rAdafruitGFX.h:15:20: error: 'Int' has not been declared
void DrawCircle(Int X0, Int Y0, Int Radius, UInt Color, bool Filled);
^
rAdafruitGFX.h:15:28: error: 'Int' has not been declared
void DrawCircle(Int X0, Int Y0, Int Radius, UInt Color, bool Filled);
^
rAdafruitGFX.h:15:36: error: 'Int' has not been declared
void DrawCircle(Int X0, Int Y0, Int Radius, UInt Color, bool Filled);
^
rAdafruitGFX.h:15:48: error: 'UInt' has not been declared
void DrawCircle(Int X0, Int Y0, Int Radius, UInt Color, bool Filled);
^
rAdafruitGFX.h:17:18: error: 'Int' has not been declared
void DrawRect(Int X0, Int Y0, Int Width, Int Height, UInt Color, bool Filled);
^
rAdafruitGFX.h:17:26: error: 'Int' has not been declared
void DrawRect(Int X0, Int Y0, Int Width, Int Height, UInt Color, bool Filled);
^
rAdafruitGFX.h:17:34: error: 'Int' has not been declared
 

Daestrum

Expert
Licensed User
Longtime User
Have you tried adding rCore.h to the extra defines. as the message looks similar to when it hasn't read the definitions for Int etc.

See this post the post
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Have you tried adding rCore.h to the extra defines. as the message looks similar to when it hasn't read the definitions for Int etc.

Brilliant! That solved the problem. So it was a bug in B4R, I hope Erel can fix this because it drove me mad for two days. Why should the Clock example work and my program not!!

Many thanks.
 
Upvote 0
Top