'Sd2Card' does not name a type
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- embedded-iot
Research direction
Start with the Card Info sketch, specifically card_check.ino, and reproduce the compilation on the listed WeMos D1 R1 and ESP8266 2.5.2 setup. Compare the sketch's Sd2Card, SdVolume, SdFile, and listing constants with the included ESP8266SdFat headers. Done means the example compiles successfully and its SD-card information and directory listing work.
Written by the indexing model from the issue text.
Description
Hi
I am trying to compile the Card Info sketch and I get the following errors:
Arduino: 1.8.10 (Windows 7), Board: "WeMos D1 R1, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"
card_check:24:1: error: 'Sd2Card' does not name a type
Sd2Card card;
^
card_check:25:1: error: 'SdVolume' does not name a type
SdVolume volume;
^
card_check:26:1: error: 'SdFile' does not name a type
SdFile root;
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino: In function 'void setup()':
card_check:45:8: error: 'card' was not declared in this scope
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
^
card_check:57:11: error: 'card' was not declared in this scope
switch (card.type()) {
^
card_check:58:10: error: 'SD_CARD_TYPE_SD1' was not declared in this scope
case SD_CARD_TYPE_SD1:
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:58:10: note: suggested alternative:
In file included from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdCard/SdSpiCard.h:33:0,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/BlockDriver.h:32,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdFat.h:32,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS\src/SDFS.h:36,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD\src/SD.h:25,
from C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:21:
C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdCard/SdInfo.h:101:15: note: 'sdfat::SD_CARD_TYPE_SD1'
const uint8_t SD_CARD_TYPE_SD1 = 1;
^
card_check:61:10: error: 'SD_CARD_TYPE_SD2' was not declared in this scope
case SD_CARD_TYPE_SD2:
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:61:10: note: suggested alternative:
In file included from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdCard/SdSpiCard.h:33:0,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/BlockDriver.h:32,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdFat.h:32,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS\src/SDFS.h:36,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD\src/SD.h:25,
from C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:21:
C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdCard/SdInfo.h:103:15: note: 'sdfat::SD_CARD_TYPE_SD2'
const uint8_t SD_CARD_TYPE_SD2 = 2;
^
card_check:64:10: error: 'SD_CARD_TYPE_SDHC' was not declared in this scope
case SD_CARD_TYPE_SDHC:
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:64:10: note: suggested alternative:
In file included from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdCard/SdSpiCard.h:33:0,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/BlockDriver.h:32,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdFat.h:32,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS\src/SDFS.h:36,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD\src/SD.h:25,
from C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:21:
C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdCard/SdInfo.h:105:15: note: 'sdfat::SD_CARD_TYPE_SDHC'
const uint8_t SD_CARD_TYPE_SDHC = 3;
^
card_check:72:8: error: 'volume' was not declared in this scope
if (!volume.init(card)) {
^
card_check:72:20: error: 'card' was not declared in this scope
if (!volume.init(card)) {
^
card_check:80:18: error: 'volume' was not declared in this scope
Serial.println(volume.fatType(), DEC);
^
card_check:96:3: error: 'root' was not declared in this scope
root.openRoot(volume);
^
card_check:99:11: error: 'LS_R' was not declared in this scope
root.ls(LS_R | LS_DATE | LS_SIZE);
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:99:11: note: suggested alternative:
In file included from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatFile.h:36:0,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/ArduinoFiles.h:33,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatLib.h:27,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdFat.h:33,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS\src/SDFS.h:36,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD\src/SD.h:25,
from C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:21:
C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatApiConstants.h:121:15: note: 'sdfat::LS_R'
const uint8_t LS_R = 8;
^
card_check:99:18: error: 'LS_DATE' was not declared in this scope
root.ls(LS_R | LS_DATE | LS_SIZE);
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:99:18: note: suggested alternative:
In file included from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatFile.h:36:0,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/ArduinoFiles.h:33,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatLib.h:27,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdFat.h:33,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS\src/SDFS.h:36,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD\src/SD.h:25,
from C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:21:
C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatApiConstants.h:117:15: note: 'sdfat::LS_DATE'
const uint8_t LS_DATE = 2;
^
card_check:99:28: error: 'LS_SIZE' was not declared in this scope
root.ls(LS_R | LS_DATE | LS_SIZE);
^
C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:99:28: note: suggested alternative:
In file included from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatFile.h:36:0,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/ArduinoFiles.h:33,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatLib.h:27,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/SdFat.h:33,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS\src/SDFS.h:36,
from C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD\src/SD.h:25,
from C:\Users\George\Documents\Sketch Folder\Card_Check\card_check\card_check.ino:21:
C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat\src/FatLib/FatApiConstants.h:119:15: note: 'sdfat::LS_SIZE'
const uint8_t LS_SIZE = 4;
^
Multiple libraries were found for "SPI.h"
Used: C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SPI
Multiple libraries were found for "SD.h"
Used: C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SD
Not used: C:\Program
Not used: C:\Users\George\Documents\Arduino\libraries\SD
Multiple libraries were found for "SDFS.h"
Used: C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SDFS
Multiple libraries were found for "SdFat.h"
Used: C:\Users\George\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266SdFat
exit status 1
'Sd2Card' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
- Dominant language
- C++
- Stars
- 560
- Forks
- 226
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wemos/D1_mini_Examples
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
wemos/D1_mini_Examples#61 ·
-
w5100 y esp8266Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
wemos/D1_mini_Examples#60 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
wemos/D1_mini_Examples#59 · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
wemos/D1_mini_Examples#58 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
wemos/D1_mini_Examples#57 · 2 comments ·
All issues in wemos/D1_mini_Examples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
hyprwm/aquamarine#426 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
amnezia-vpn/amnezia-client#3222 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sdatkinson/NeuralAmpModelerCore#342 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
valkey-io/valkey-search#1465 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
KhronosGroup/Vulkan-Tutorial#524 ·
Maintainers usually reply within 1 day