B4R Question The ESP32 DEVKIT V1 development board USES the ESP8266WiFi library, and there is a problem

santook

Member
B4R 版本号: 2.51
解析代码。 (0.00s)
编译代码。 (0.02s)
构建项目 (0.04s)
正在编译和部署Ino项目 (DOIT ESP32 DEVKIT V1 - COM7) Error
正在加载配置...
正在初始化包...
正在准备开发板...
正在验证...
In file included from c:\users\santook station\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\functional:48:0,
from C:\Users\santook station\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi\src/WiFiGeneric.h:28,
from C:\Users\santook station\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi\src/WiFiSTA.h:28,
from C:\Users\santook station\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi\src/WiFi.h:32,
from J:\Objects\bin\sketch\rESP8266WiFi.h:4,
from J:\Objects\bin\sketch\B4RDefines.h:25,
from J:\Objects\bin\sketch\B4RArduino.cpp:1:
c:\users\santook station\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\new: In function 'void* operator new(std::size_t, void*)':
c:\users\santook station\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-80-g6c4433a-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\new:129:51: error: declaration of 'void* operator new(std::size_t, void*) noexcept' has a different exception specifier
inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
^
In file included from J:\Objects\bin\sketch\B4RDefines.h:24:0,
from J:\Objects\bin\sketch\B4RArduino.cpp:1:
rCore.h:18: error: from previous declaration 'void* operator new(size_t, void*)'
extern void *operator new( size_t size, void *ptr );

^
"WiFi.h" 对应多个库
已使用: C:\Users\santook station\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi
未使用:C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1
 

santook

Member
I try to do that
The previous error is prompted either inside or outside the #Region Project Attributes
The problem has not improved
 
Upvote 0

santook

Member
B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 300
    #DefineExtra:#define SKIP_B4RNEW
#End Region
    
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public Serial1 As Serial
    Public x As ESP8266WiFi
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The previous error is prompted either inside or outside the #Region Project Attributes
It doesn't matter where you put it.

Maybe you are using an old version of rCore library.

rCore.h:18 should be excluded.

This is the relevant code from this file:
B4X:
#if !defined(_NEW) && !defined(SKIP_B4RNEW)
extern void *operator new( size_t size, void *ptr ); <-- line 18
#endif
 
Upvote 0

santook

Member
I'm using B4R version 2.51
rCore.h was modified in 2018.6.3 16:05
The file contents only include:
# if! Defined (_NEW)
Extern void *operator new(size_t size, void * PTR);
# endif
/ / ~ version: 2.00
 
Upvote 0

santook

Member
I tried to modify the rcore.h file and replaced the original. Finally, the compilation was successful.
I wonder if this was a Bug when version 2.51 was released
 
Upvote 0
Top