Arduino错误编译

Arduino error compiling

我的新代码出现编译错误。我找不到任何错误。我搜索了 google。任何帮助都会很棒。请参阅下面的代码和错误消息。

代码: http://pastebin.com/cLprnCRz

错误信息: http://pastebin.com/azkc9QLY

好吧,你的错误不在你的代码中,它在你包含 sha1.h 的文件中,该文件从 Print.h 实现了一个虚拟方法,但 return 类型错误:

在sha1.h中:

virtual void Sha1Class::write(uint8_t)
        ^^^^

在 Print.h 中:

virtual size_t Print::write(uint8_t)
        ^^^^^^

您的 sha1 库可能是为不同版本的 Arduino 框架编写的。

错误很明显,正如它所说:

error: conflicting return type specified for 'virtual void Sha1Class::write(uint8_t)'
error:   overriding 'virtual size_t Print::write(uint8_t)'

所以编译器在这里说:

"You're defining in Print.h a method that has to be reimplemented of a given type, and when you're reimplementing it, you're giving it another type. I did my best, but really, I don't understand what you want!"