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 #2

Open
Walker78431 opened this issue Dec 25, 2022 · 0 comments
Open

compilation error #2

Walker78431 opened this issue Dec 25, 2022 · 0 comments

Comments

@Walker78431
Copy link

When I was uploading esp32-i2s-sdcard-wav-player-builtin-DAC.ino, there was an compilation error:

`C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:29:1: error: 'File' does not name a type
File root;
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:16: error: 'File' was not declared in this scope
int read4bytes(File file, uint32_t chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:16: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:36: error: expected primary-expression before '
' token
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:37: error: 'chunkId' was not declared in this scope
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:44: error: expression list treated as compound expression in initializer [-fpermissive]
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:14: error: 'File' was not declared in this scope
int readbyte(File file, uint8_t chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:14: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:33: error: expected primary-expression before '
' token
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:34: error: 'chunkId' was not declared in this scope
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:41: error: expression list treated as compound expression in initializer [-fpermissive]
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:14: error: 'File' was not declared in this scope
int readRiff(File file, wavRiff_t wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:14: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:35: error: expected primary-expression before '
' token
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:36: error: 'wavRiff' was not declared in this scope
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:43: error: expression list treated as compound expression in initializer [-fpermissive]
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:15: error: 'File' was not declared in this scope
int readProps(File file, wavProperties_t wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:15: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:42: error: expected primary-expression before '
' token
int readProps(File file, wavProperties_t *wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:51: error: expression list treated as compound expression in initializer [-fpermissive]
int readProps(File file, wavProperties_t *wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:16: error: redefinition of 'int read4bytes'
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:5: note: 'int read4bytes' previously defined here
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:16: error: 'File' was not declared in this scope
int read4bytes(File file, uint32_t chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:16: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:36: error: expected primary-expression before '
' token
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:59:37: error: 'chunkId' was not declared in this scope
int read4bytes(File file, uint32_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:14: error: redefinition of 'int readbyte'
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:5: note: 'int readbyte' previously defined here
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:14: error: 'File' was not declared in this scope
int readbyte(File file, uint8_t chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:14: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:33: error: expected primary-expression before '
' token
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:64:34: error: 'chunkId' was not declared in this scope
int readbyte(File file, uint8_t *chunkId){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:14: error: redefinition of 'int readRiff'
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:5: note: 'int readRiff' previously defined here
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:14: error: 'File' was not declared in this scope
int readRiff(File file, wavRiff_t wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:14: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:35: error: expected primary-expression before '
' token
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:70:36: error: 'wavRiff' was not declared in this scope
int readRiff(File file, wavRiff_t *wavRiff){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:15: error: redefinition of 'int readProps'
int readProps(File file, wavProperties_t *wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:5: note: 'int readProps' previously defined here
int readProps(File file, wavProperties_t *wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:15: error: 'File' was not declared in this scope
int readProps(File file, wavProperties_t wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:15: note: suggested alternative:
In file included from C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:1:0:
c:\Users\nn\Documents\Arduino\libraries\esp32-micro-sdcard-master/mySD.h:33:9: note: 'ext::File'
class File : public Stream {
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:74:42: error: expected primary-expression before '
' token
int readProps(File file, wavProperties_t *wavProps){
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino: In function 'void setup()':
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:90:3: error: 'root' was not declared in this scope
root = SD.open("T.WAV");
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:98:36: error: 'readRiff' cannot be used as a function
n = readRiff(root, &wavRiff);
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:107:38: error: 'readProps' cannot be used as a function
n = readProps(root, &wavProps);
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:114:38: error: 'read4bytes' cannot be used as a function
n = read4bytes(root, &chunkId);
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:120:40: error: 'read4bytes' cannot be used as a function
n = read4bytes(root, &chunkSize);
^
C:\Users\nn\AppData\Local\Temp.arduinoIDE-unsaved20221125-22272-1pm0jdd.84sx\sketch_dec25b\sketch_dec25b.ino:134:33: error: 'readbyte' cannot be used as a function
n = readbyte(root, &data);
^

exit status 1

Compilation error: 'File' does not name a type`

How to deal with it? Thanks in advance.

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

1 participant