bitbank2 / PNGenc

An embedded-friendly PNG encoder
Apache License 2.0
39 stars 8 forks source link

Problem - compiling example #12

Closed classic-audio closed 1 year ago

classic-audio commented 1 year ago

I am getting this: 'O_READ' was not declared in this scope

Help please?

bitbank2 commented 1 year ago

This library was written to work on Arduino, Linux and MacOS. Can you be more specific and provide the full error?

classic-audio commented 1 year ago

Of course

ESP32

the error text

`

C:\Users\Frede\AppData\Local\Temp\arduino_modified_sketch_663949\PNGenc_Test.ino: In function 'void myOpen(const char)': PNGenc_Test:30:29: error: 'O_READ' was not declared in this scope myfile = SD.open(filename, O_READ| O_WRITE | O_CREAT); ^ PNGenc_Test:30:37: error: 'O_WRITE' was not declared in this scope myfile = SD.open(filename, O_READ| O_WRITE | O_CREAT); ^ PNGenc_Test:30:47: error: 'O_CREAT' was not declared in this scope myfile = SD.open(filename, O_READ| O_WRITE | O_CREAT); ^ Multiple libraries were found for "SD.h" Used: C:\Users\Frede\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\SD Not used: C:\Program Files (x86)\Arduino\libraries\SD Not used: C:\Users\Frede\Documents\Arduino\libraries\SD exit status 1 'O_READ' was not declared in this scope `

bitbank2 commented 1 year ago

I guess I was using an older version of the SD library when I wrote it. Change the line to:

myfile = SD.open(filename, "w");