Arduino IDE 可以用来开发普通的旧 C 程序吗?

发布于 2024-12-10 08:58:12 字数 178 浏览 0 评论 0原文

我有一个简单的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦在夏天 2024-12-17 08:58:12

Arduino IDE 非常有限,我的建议是:避免使用它。您可以在这里找到一些替代方案:http://arduino.cc/playground/Main/DevelopmentTools


  • 使用 Minibloq 图形编程环境进行 Arduino 开发。
  • Arduino CMake 构建系统
  • Ino Arduino 命令行工具包
  • 使用 AVR-Ada 为 Arduino 开发 使用
  • Eclipse
  • 为 Arduino 开发 使用 Bitlash 为 Arduino 开发
  • 从命令行运行 Arduino
  • 使用 Cmake
  • 构建 使用 Scons
  • 构建 使用 build_arduino.py
  • 构建 让 Chumby 与 Arduino 对话
  • 在 XO 笔记本电脑(又称 100 美元笔记本电脑)上运行 Arduino
  • 在 Sharp Netwalker 中
  • 运行Arduino OpenSolaris 上的 Arduino
  • 中使用 Arduino 库
  • 在 CodeBlocks开发 对于使用 Kdevelop 的 Arduino
  • 在 Arduino IDE 中使用汇编语言源文件:Arduino 中的汇编

The Arduino IDE is very limited, my advice: avoid it. You have some alternatives you can find here: http://arduino.cc/playground/Main/DevelopmentTools


  • Develop for Arduino using Minibloq graphical programming environment.
  • Arduino CMake build system
  • Ino command line toolkit for Arduino
  • Develop for Arduino using AVR-Ada
  • Develop for Arduino using Eclipse
  • Develop for Arduino using Bitlash
  • Run Arduino from the command line
  • Build using Cmake
  • Build using Scons
  • Build using build_arduino.py
  • Getting a Chumby talking to Arduino
  • Running Arduino on the XO laptop (AKA the $100 laptop)
  • Arduino in Sharp Netwalker
  • Arduino on OpenSolaris
  • Using Arduino Libraries in CodeBlocks
  • Develop for Arduino using Kdevelop
  • Using assembly language source files in the Arduino IDE: Assembly in Arduino
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文