Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error: 'min' was not declared in this scope #2

Open
Manulatech opened this issue Dec 15, 2024 · 2 comments
Open

Compilation error: 'min' was not declared in this scope #2

Manulatech opened this issue Dec 15, 2024 · 2 comments

Comments

@Manulatech
Copy link

In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.h:6,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\setting.cpp:3:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.h:6,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\spam_ap.cpp:3:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.h:6,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.cpp:2:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\RTL8720DN-BW16-SH1107-OLED.ino:6:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.h:6,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\menu.cpp:5:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.h:6,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\deauther.cpp:5:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
In file included from c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:13:0,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\util.h:6,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\scan_ap.cpp:4:
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:95:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0, SPIClass theSPI = &SPI);
^~~~~~~~~
c:\Users\fonta\OneDrive\Documentos\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:104:41: error: 'SPI_MODE0' was not declared in this scope
uint8_t dataMode = SPI_MODE0);
^~~~~~~~~
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\scan_ap.cpp: In function 'void showWifiScanResult()':
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\scan_ap.cpp:179:62: error: 'min' was not declared in this scope
uint8_t endIndex = min(startIndex + itemsPerPage, wifiCount);
^
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\scan_ap.cpp:179:62: note: suggested alternative:
In file included from c:\users\fonta\appdata\local\arduino15\packages\realtek\tools\ameba_d_asdk_toolchain\1.0.1\arm-none-eabi\include\c++\6.5.0\bits\char_traits.h:39:0,
from c:\users\fonta\appdata\local\arduino15\packages\realtek\tools\ameba_d_asdk_toolchain\1.0.1\arm-none-eabi\include\c++\6.5.0\string:40,
from C:\Users\fonta\AppData\Local\Arduino15\packages\realtek\hardware\AmebaD\3.1.7\cores\ambd/Arduino.h:36,
from C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\scan_ap.cpp:1:
c:\users\fonta\appdata\local\arduino15\packages\realtek\tools\ameba_d_asdk_toolchain\1.0.1\arm-none-eabi\include\c++\6.5.0\bits\stl_algobase.h:243:5: note: 'std::min'
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp: In function 'void wifi_tx_raw_frame(void
, size_t)':
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp:12:50: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
void *frame_control = alloc_mgtxmitframe(ptr + 0xae0);
^~~~~
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp:15:50: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
update_mgntframe_attrib(ptr, frame_control + 8);
^
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp:16:50: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
memset((void )(uint32_t *)(frame_control + 0x80), 0, 0x68);
^~~~
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp:17:68: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
uint8_t *frame_data = (uint8_t )(uint32_t *)(frame_control + 0x80) + 0x28;
^~~~
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp:19:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
*(uint32_t *)(frame_control + 0x14) = length;
^~~~
C:\Users\fonta\Downloads\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED-0.1.2\RTL8720DN-BW16-SH1107-OLED\wifi_cust_tx.cpp:20:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
*(uint32_t *)(frame_control + 0x18) = length;
^~~~

exit status 1

Compilation error: 'min' was not declared in this scope

@Byllyy
Copy link

Byllyy commented Jan 12, 2025

Same problem here.
Please help.

@epiHATR
Copy link
Owner

epiHATR commented Jan 13, 2025

Use Ameba Realtek Ameba board 3.1.5, this version should work.

Beside that, we can add this in the beginning of the error file

#undef min

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants