- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
这应该是个简单的问题。我正在尝试将代码拆分为草图中的两个文件:
测试.ino:
void setup(){}
void loop(){ fn(); }
测试.c:
char myChar = '?';
void fn(){ myChar++; }
我试过使用具有各种配置的 test.h 文件,例如具有以下行:
extern char myChar;
,char myChar;
void fn();
extern void fn();
以及在不同文件中包含 test.c 和 test.h 文件的各种组合,但我总是遇到一个或另一个编译器错误,例如:
test.cpp.o:(.data.myChar+0x0): multiple definition of `myChar'
test.c.o:(.data.myChar+0x0): first defined here
或者
test.cpp.o: In function `setup':
C:\Program Files\arduino-1.0.4/test.ino:4: undefined reference to `fn()'
我真的用这个把我的头发拉出来。任何帮助将不胜感激
最佳答案
Arduino IDE 真正适合初学者。随着您变得更好,您可能希望分支到更传统的编程工具。
Arduino 项目实际上只是 c/c++ 应用程序。在这方面,您拥有整个 c/c++ 社区的支持。他们最喜欢和最鄙视的工具之一叫做 make。您可以使用它来部署和构建您的项目。这是一个很好的起点。 http://ed.am/dev/make/arduino-mk/arduino.mk
关于c - 阿杜诺 & C : put a function and global variable in external file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16510521/
我正在尝试为我的应用执行“部署:冷”。 git repo 是本地的我的部署服务器(即我只有一台服务器用于所有内容,而且我不要在 github 上托管我的代码)。 这是成绩单(出于隐私考虑,将我的应用名
我是一名优秀的程序员,十分优秀!