|
|
发表于 2014-10-31 01:53:45
|
显示全部楼层
奇怪的 bug....幾乎把我折磨死了.
剛升安裝了新的 stino, 就好了設定, 就嘗試用 1.5.8 compile 一個程式....失敗.
當試轉回 1.0.6, 同樣失敗.
改回之前的 stino, 用 1.0.6....正常.
而出現的 error 非常怪, 是 undefined reference to <一個自己設定的 function>, 當然, 這個 function 是存在的, 不然用回舊版也不行.
多番嘗試, 把程式不斷刪減, 終於找出問題了, 在新版中, #if 之下的 #define 不可以縮進去.
超簡單程式如下:
- #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
- #define MEMORY_MAX 8192
- #else
- #define MEMORY_MAX 2048
- #endif
- void setup() {
- // put your setup code here, to run once:
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
复制代码
將會出現以下 error:
[Stino - Start building "BareMinimum"...]
Creating C:\Users\James\Documents\Arduino_build\BareMinimum\BareMinimum.ino.cpp.o...
Creating BareMinimum.elf...
C:/Users/James/Documents/Arduino_build/BareMinimum/core.a(main.cpp.o): In function `main':
E:/Arduino/IDE/arduino-1.0.6/hardware/arduino/cores/arduino/main.cpp:40: undefined reference to `setup'
E:/Arduino/IDE/arduino-1.0.6/hardware/arduino/cores/arduino/main.cpp:43: undefined reference to `loop'
[Stino - Exit with error code 1]
但只要把第 2 行的 #define 前的空白刪走, 就不會有問題了.
而第 4 行同樣是 #define 句子, 前面的空白不會有問題.
希望大大可以嘗試 fix 這個問題吧.
|
|