GyverLibs / FastBot

Многофункциональная быстрая библиотека для Телеграм бота на esp8266/esp32
MIT License
185 stars 31 forks source link

Конфликтует с библиотекой TFT_eSPI.h #64

Open M0rrb opened 8 months ago

M0rrb commented 8 months ago

Если в декларации библиотек #include стоит перед #include то компилятор выдает ошибку:

In file included from C:\Temp.arduinoIDE-unsaved2024014-9364-1vnyn07.ae0z\demo\demo.ino:15: c:\Arduino\libraries\FastBot\src/FastBot.h:808:22: error: 'File' has not been declared uint8_t sendFile(File &file, FB_FileType type, const String& name, const String& id) { ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:811:22: error: 'File' has not been declared uint8_t sendFile(File &file, FB_FileType type, const String& name) { ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:824:22: error: 'File' has not been declared uint8_t editFile(File &file, FB_FileType type, const String& name, int32_t msgid, const String& id) { ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:827:22: error: 'File' has not been declared uint8_t editFile(File &file, FB_FileType type, const String& name, int32_t msgid) { ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:835:23: error: 'File' has not been declared bool downloadFile(File &f, const String& url) { ^~~~ In file included from C:\Temp.arduinoIDE-unsaved2024014-9364-1vnyn07.ae0z\demo\demo.ino:15: c:\Arduino\libraries\FastBot\src/FastBot.h:980:53: error: 'File' has not been declared void _sendFileRoutine(FB_SECURE_CLIENT& client, File &file) { ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:1018:23: error: 'File' has not been declared uint8_t _sendFile(File &file, FB_FileType type, const String& name, const String& id) { ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:1037:23: error: 'File' has not been declared uint8_t _editFile(File& file, FB_FileType type, const String& name, int32_t msgid, const String& id) { ^~~~ In file included from C:\Temp.arduinoIDE-unsaved2024014-9364-1vnyn07.ae0z\demo\demo.ino:15: c:\Arduino\libraries\FastBot\src/FastBot.h: In member function 'bool FastBot::downloadFile(int&, const String&)': c:\Arduino\libraries\FastBot\src/FastBot.h:848:40: error: no matching function for call to 'HTTPClient::writeToStream(int)' if (_http->writeToStream(&f)) stat = 1; ^ In file included from c:\Arduino\libraries\FastBot\src/FastBot.h:147, from C:\Temp.arduinoIDE-unsaved2024014-9364-1vnyn07.ae0z\demo\demo.ino:15: C:\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\HTTPClient\src/HTTPClient.h:240:9: note: candidate: 'int HTTPClient::writeToStream(Stream)' int writeToStream(Stream stream); ^~~~~ C:\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\HTTPClient\src/HTTPClient.h:240:9: note: no known conversion for argument 1 from 'int' to 'Stream*' In file included from C:\Temp.arduinoIDE-unsaved2024014-9364-1vnyn07.ae0z\demo\demo.ino:15: c:\Arduino\libraries\FastBot\src/FastBot.h:851:11: error: request for member 'close' in 'f', which is of non-class type 'int' f.close(); ^~~~~ In file included from C:\Temp.arduinoIDE-unsaved2024014-9364-1vnyn07.ae0z\demo\demo.ino:15: c:\Arduino\libraries\FastBot\src/FastBot.h: In member function 'void FastBot::_sendFileRoutine(WiFiClientSecure&, int&)': c:\Arduino\libraries\FastBot\src/FastBot.h:982:28: error: request for member 'size' in 'file', which is of non-class type 'int' uint32_t sz = file.size(); ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h:985:18: error: request for member 'read' in 'file', which is of non-class type 'int' file.read(buf, len); ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h: In member function 'uint8_t FastBot::_sendFile(int&, FB_FileType, const String&, const String&)': c:\Arduino\libraries\FastBot\src/FastBot.h:1020:42: error: request for member 'size' in 'file', which is of non-class type 'int' if (!_multipartSend(client, file.size(), type, name, id)) return 4; ^~~~ c:\Arduino\libraries\FastBot\src/FastBot.h: In member function 'uint8_t FastBot::_editFile(int&, FB_FileType, const String&, int32_t, const String&)': c:\Arduino\libraries\FastBot\src/FastBot.h:1039:42: error: request for member 'size' in 'file', which is of non-class type 'int' if (!_multipartEdit(client, file.size(), type, name, msgid, id)) return 4; ^~~~

exit status 1

если порядок библиотек идет наоборот:

include

include

, то все ок

GyverLibs commented 7 months ago

Да, espi ломает библиотеку работы с файлами