Closed Silver-Fang closed 5 months ago
Hi @Silver-Fang. Thanks for taking the time to submit an issue.
I see we have another report about this at https://github.com/arduino/arduino-cli/issues/1269.
It is best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.
As I mentioned in the other issue thread, the workaround is to manually add the function prototype at the appropriate location in the sketch, after the definition of the E
type:
enum E
{
OS
};
E D(); // Function prototype
E D()
{
I see there are also several bugs in your code that are simply a matter of it being invalid rather than anything caused by a defect or limitation in the Arduino sketch build system. So you will find the sketch still won't compile even after adding the prototype. If you would like assistance with those other problems, you are welcome to post over on Arduino Forum. I'm sure we will be able to help you over there:
https://forum.arduino.cc/c/using-arduino/programming-questions/20
Describe the problem
To reproduce
Expected behavior
I have verified this code in MSVC, and there should be no problem.
Arduino IDE version
版本:2.2.1 日期:2023-08-31T14:35:44.802Z CLI 版本:0.34.0 Copyright © 2024 Arduino SA
Operating system
Windows
Operating system version
版本 Windows 11 专业版 Insider Preview 版本号 23H2 安装日期 2024/1/28 操作系统版本 26040.1000 体验 Windows Feature Experience Pack 1000.26040.1000.0
Additional context
No response
Issue checklist