Arduino IDE 可以用来开发普通的旧 C 程序吗?
我有一个简单的 Arduino 草图,包含多个文件。 h 文件中有函数签名,C 文件中有定义。
如果我尝试编译(“验证”)草图,我会收到 C 文件中定义的函数的“未定义引用”错误。将文件名从 *.c 更改为 *.cpp 可以解决该问题,但我不想将该文件定义为 C++ 文件。是否可以在 Arduino 中编译普通的旧 C 文件?
I have a simple Arduino sketch that spans several files. There is a function signature in an h file, and the definition in the C file.
If I attempt to compile ("Verify") the sketch, I get "undefined reference" errors to the function defined in a C file. Changing the file name from *.c to *.cpp resolves the issue, but I don't want to define the file as a C++ file. Is it possible to compile plain old C files in Arduino?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Arduino IDE 非常有限,我的建议是:避免使用它。您可以在这里找到一些替代方案:http://arduino.cc/playground/Main/DevelopmentTools
The Arduino IDE is very limited, my advice: avoid it. You have some alternatives you can find here: http://arduino.cc/playground/Main/DevelopmentTools