开源改变世界

无法使用 Makefile 使用 LCD 构建 #269

推推 grbl 2年前 (2023-02-05) 216次浏览
关闭
乔丹 打开了这个问题 2012 年 10 月 16 日 · 15条评论
关闭

无法使用 Makefile 使用 LCD 构建#269

乔丹 打开了这个问题 2012 年 10 月 16 日 · 15条评论

评论

无法使用 Makefile 使用 LCD 构建 #269
贡献者

在构建主文件并启用 LCD 支持时,似乎没有将 -mmcu=atmegaXXXX 选项传递给 GCC。由于每次运行时的错误消息都不同,因此构建过程中似乎存在未声明的依赖项。

取消注释这些行之一无济于事:

#CXXSRC += LiquidCrystal.cpp ultralcd.cpp                                                                     
#CXXSRC += ultralcd.cpp 

请指教。

第一次运行时的错误文本:

joe@spinoza:~/reprap/Marlin/Marlin$ make
  WR    applet/Marlin.cpp
  CC    applet/pins_arduino.o
  CC    applet/wiring.o
  CC    applet/wiring_analog.o
  CC    applet/wiring_digital.o
  CC    applet/wiring_pulse.o
  CC    applet/wiring_shift.o
  CC    applet/WInterrupts.o
  CXX   applet/WMath.o
  CXX   applet/WString.o
  CXX   applet/Print.o
avr-g++ -DF_CPU=16000000 -I . -I applet -I mega2560/cores/arduino -I /home/joe/reprap/build/arduino/hardware/arduino/cores/arduino -I /home/joe/reprap/build/arduino/libraries/LiquidCrystal -Os -Wall     -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -w -ffunction-sections -fdata-sections -DARDUINO=22 -DMOTHERBOARD=33   -c -o applet/Marlin.o applet/Marlin.cpp
In file included from ./Marlin.h:24,
                 from ./Marlin.pde:30,
                 from applet/Marlin.cpp:2:
./fastio.h:2579:2: error: #error pins for this chip not defined in arduino.h! If you write an appropriate pin definition and have this firmware work on your chip, please submit a pull request
In file included from ./Marlin.h:26,
                 from ./Marlin.pde:30,
                 from applet/Marlin.cpp:2:
./pins.h:244:3: error: #error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
In file included from ./Sd2Card.h:31,
                 from ./SdVolume.h:29,
                 from ./SdBaseFile.h:31,
                 from ./SdFile.h:27,
                 from ./cardreader.h:6,
                 from ./Marlin.pde:37,
                 from applet/Marlin.cpp:2:
./Sd2PinMap.h:317:2: error: #error unknown chip
In file included from ./Marlin.h:38,
                 from ./Marlin.pde:30,
                 from applet/Marlin.cpp:2:
./MarlinSerial.h: In member function ‘int MarlinSerial::available()’:
./MarlinSerial.h:66: error: ‘rx_buffer’ was not declared in this scope
./MarlinSerial.h: In member function ‘void MarlinSerial::write(uint8_t)’:
./MarlinSerial.h:71: error: ‘UCSR0A’ was not declared in this scope
./MarlinSerial.h:71: error: ‘UDRE0’ was not declared in this scope
./MarlinSerial.h:74: error: ‘UDR0’ was not declared in this scope
./MarlinSerial.h: In member function ‘void MarlinSerial::checkRx()’:
./MarlinSerial.h:80: error: ‘UCSR0A’ was not declared in this scope
./MarlinSerial.h:80: error: ‘RXC0’ was not declared in this scope
./MarlinSerial.h:81: error: ‘UDR0’ was not declared in this scope
./MarlinSerial.h:82: error: ‘rx_buffer’ was not declared in this scope
In file included from ./Sd2Card.h:31,
                 from ./SdVolume.h:29,
                 from ./SdBaseFile.h:31,
                 from ./SdFile.h:27,
                 from ./cardreader.h:6,
                 from ./Marlin.pde:37,
                 from applet/Marlin.cpp:2:
./Sd2PinMap.h: At global scope:
./Sd2PinMap.h:320: error: ‘digitalPinMap’ was not declared in this scope
./Sd2PinMap.h: In function ‘bool getPinMode(uint8_t)’:
./Sd2PinMap.h:328: error: ‘digitalPinMap’ was not declared in this scope
./Sd2PinMap.h: In function ‘void setPinMode(uint8_t, uint8_t)’:
./Sd2PinMap.h:337: error: ‘digitalPinMap’ was not declared in this scope
./Sd2PinMap.h:339: error: ‘digitalPinMap’ was not declared in this scope
./Sd2PinMap.h: In function ‘bool fastDigitalRead(uint8_t)’:
./Sd2PinMap.h:348: error: ‘digitalPinMap’ was not declared in this scope
./Sd2PinMap.h: In function ‘void fastDigitalWrite(uint8_t, uint8_t)’:
./Sd2PinMap.h:357: error: ‘digitalPinMap’ was not declared in this scope
./Sd2PinMap.h:359: error: ‘digitalPinMap’ was not declared in this scope
In file included from ./SdVolume.h:29,
                 from ./SdBaseFile.h:31,
                 from ./SdFile.h:27,
                 from ./cardreader.h:6,
                 from ./Marlin.pde:37,
                 from applet/Marlin.cpp:2:
./Sd2Card.h: At global scope:
./Sd2Card.h:129: error: ‘SS_PIN’ was not declared in this scope
./Sd2Card.h:132: error: ‘MOSI_PIN’ was not declared in this scope
./Sd2Card.h:134: error: ‘MISO_PIN’ was not declared in this scope
./Sd2Card.h:136: error: ‘SCK_PIN’ was not declared in this scope
In file included from ./Marlin.pde:39,
                 from applet/Marlin.cpp:2:
./EEPROMwrite.h: In function ‘int EEPROM_writeAnything(int&, const T&)’:
./EEPROMwrite.h:22: error: there are no arguments to ‘eeprom_write_byte’ that depend on a template parameter, so a declaration of ‘eeprom_write_byte’ must be available
./EEPROMwrite.h:22: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
./EEPROMwrite.h: In function ‘int EEPROM_readAnything(int&, T&)’:
./EEPROMwrite.h:31: error: there are no arguments to ‘eeprom_read_byte’ that depend on a template parameter, so a declaration of ‘eeprom_read_byte’ must be available
In file included from applet/Marlin.cpp:2:
./Marlin.pde: In function ‘void setup()’:
./Marlin.pde:297: error: ‘MCUSR’ was not declared in this scope
./Marlin.pde: In function ‘void process_commands()’:
./Marlin.pde:849: error: ‘DIO38_RPORT’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:849: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_RPORT’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:850: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_RPORT’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:851: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_RPORT’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:852: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1121: error: ‘DIO12_DDR’ was not declared in this scope
./Marlin.pde:1121: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_RPORT’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1122: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1132: error: ‘DIO12_DDR’ was not declared in this scope
./Marlin.pde:1132: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_RPORT’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_WPORT’ was not declared in this scope
./Marlin.pde:1133: error: ‘DIO12_PIN’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_RPORT’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1154: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_RPORT’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1162: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_RPORT’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1163: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_RPORT’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1164: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_RPORT’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1167: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1235: error: ‘DIO3_RPORT’ was not declared in this scope
./Marlin.pde:1235: error: ‘DIO3_PIN’ was not declared in this scope
./Marlin.pde:1243: error: ‘DIO14_RPORT’ was not declared in this scope
./Marlin.pde:1243: error: ‘DIO14_PIN’ was not declared in this scope
./Marlin.pde:1251: error: ‘DIO18_RPORT’ was not declared in this scope
./Marlin.pde:1251: error: ‘DIO18_PIN’ was not declared in this scope
./Marlin.pde: In function ‘void manage_inactivity()’:
./Marlin.pde:1701: error: ‘DIO38_RPORT’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1701: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_RPORT’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1702: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_RPORT’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1703: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_RPORT’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1704: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde: In function ‘void kill()’:
./Marlin.pde:1744: error: ‘DIO38_RPORT’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_WPORT’ was not declared in this scope
./Marlin.pde:1744: error: ‘DIO38_PIN’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_RPORT’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_WPORT’ was not declared in this scope
./Marlin.pde:1745: error: ‘DIO56_PIN’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_RPORT’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_WPORT’ was not declared in this scope
./Marlin.pde:1746: error: ‘DIO62_PIN’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_RPORT’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_PIN’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_WPORT’ was not declared in this scope
./Marlin.pde:1747: error: ‘DIO24_PIN’ was not declared in this scope
make: *** [applet/Marlin.o] Error 1

第二次 make 调用时的错误文本:


joe@spinoza:~/reprap/Marlin/Marlin$ make
  CXX   applet/Marlin.o
  CXX   applet/MarlinSerial.o
  CXX   applet/Sd2Card.o
  CXX   applet/SdBaseFile.o
  CXX   applet/SdFatUtil.o
  CXX   applet/SdFile.o
  CXX   applet/SdVolume.o
  CXX   applet/motion_control.o
  CXX   applet/planner.o
  CXX   applet/stepper.o
  CXX   applet/temperature.o
  CXX   applet/cardreader.o
  AR    applet/pins_arduino.o
  AR    applet/wiring.o
  AR    applet/wiring_analog.o
  AR    applet/wiring_digital.o
  AR    applet/wiring_pulse.o
  AR    applet/wiring_shift.o
  AR    applet/WInterrupts.o
  AR    applet/WMath.o
  AR    applet/WString.o
  AR    applet/Print.o
  AR    applet/Marlin.o
  AR    applet/MarlinSerial.o
  AR    applet/Sd2Card.o
  AR    applet/SdBaseFile.o
  AR    applet/SdFatUtil.o
  AR    applet/SdFile.o
  AR    applet/SdVolume.o
  AR    applet/motion_control.o
  AR    applet/planner.o
  AR    applet/stepper.o
  AR    applet/temperature.o
  AR    applet/cardreader.o
  CXX   applet/Marlin.elf
/tmp/ccl3bFYq.o: In function `Stop()':
Marlin.cpp:(.text._Z4Stopv+0x7e): undefined reference to `lcd_statuspgm(char const*)'
/tmp/ccl3bFYq.o: In function `kill()':
Marlin.cpp:(.text._Z4killv+0x6e): undefined reference to `lcd_alertstatuspgm(char const*)'
/tmp/ccl3bFYq.o: In function `process_commands()':
Marlin.cpp:(.text._Z16process_commandsv+0xd6): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x14c): undefined reference to `lcd_status()'
Marlin.cpp:(.text._Z16process_commandsv+0x71c): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x7a6): undefined reference to `buttons'
Marlin.cpp:(.text._Z16process_commandsv+0x7b8): undefined reference to `lcd_status()'
Marlin.cpp:(.text._Z16process_commandsv+0x7c6): undefined reference to `lcd_status()'
Marlin.cpp:(.text._Z16process_commandsv+0x7cc): undefined reference to `buttons'
Marlin.cpp:(.text._Z16process_commandsv+0x7da): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0xb18): undefined reference to `lcd_status(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0xe72): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x107e): undefined reference to `lcd_status()'
Marlin.cpp:(.text._Z16process_commandsv+0x11f2): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x1344): undefined reference to `lcd_status()'
Marlin.cpp:(.text._Z16process_commandsv+0x1364): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x147a): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x15f4): undefined reference to `lcd_status(char const*)'
Marlin.cpp:(.text._Z16process_commandsv+0x20be): undefined reference to `lcd_statuspgm(char const*)'
/tmp/ccl3bFYq.o: In function `get_command()':
Marlin.cpp:(.text._Z11get_commandv+0x426): undefined reference to `lcd_statuspgm(char const*)'
Marlin.cpp:(.text._Z11get_commandv+0x662): undefined reference to `lcd_status(char const*)'
/tmp/ccl3bFYq.o: In function `loop':
Marlin.cpp:(.text.loop+0x102): undefined reference to `lcd_status()'
/tmp/ccl3bFYq.o: In function `setup':
Marlin.cpp:(.text.setup+0x31a): undefined reference to `lcd_init()'
applet/core.a(stepper.o): In function `st_synchronize()':
stepper.cpp:(.text._Z14st_synchronizev+0x14): undefined reference to `lcd_status()'
applet/core.a(stepper.o): In function `finishAndDisableSteppers()':
stepper.cpp:(.text._Z24finishAndDisableSteppersv+0x8): undefined reference to `lcd_statuspgm(char const*)'
applet/core.a(temperature.o): In function `__vector_22':
temperature.cpp:(.text.__vector_22+0xc8): undefined reference to `buttons_check()'
temperature.cpp:(.text.__vector_22+0x122): undefined reference to `buttons_check()'
temperature.cpp:(.text.__vector_22+0x178): undefined reference to `buttons_check()'
temperature.cpp:(.text.__vector_22+0x1b8): undefined reference to `buttons_check()'
applet/core.a(temperature.o): In function `PID_autotune(float, int, int)':
temperature.cpp:(.text._Z12PID_autotunefii+0x904): undefined reference to `lcd_status()'
applet/core.a(cardreader.o): In function `CardReader::openFile(char*, bool)':
cardreader.cpp:(.text._ZN10CardReader8openFileEPcb+0x404): undefined reference to `lcd_status(char const*)'
applet/core.a(planner.o): In function `plan_buffer_line(float const&, float const&, float const&, float const&, float, unsigned char const&)':
planner.cpp:(.text._Z16plan_buffer_lineRKfS0_S0_S0_fRKh+0x90): undefined reference to `lcd_status()'
make: *** [applet/Marlin.elf] Error 1
无法使用 Makefile 使用 LCD 构建 #269

你有没有设法解决这个问题?我一直试图让 Marlin 编译,但我遇到了这个问题。

无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

不,它对我来说仍然不起作用。我正在认真考虑制作一个带有 scons 的替代构建系统,这使得依赖处理变得轻而易举。

我仍然不明白构建问题背后的核心问题。引用未从主模块导出的变量“starttime”也存在问题。

无法使用 Makefile 使用 LCD 构建 #269

我设法修复了它,我将在接下来的几天中尝试对 git checkout 进行比较。

有多个问题,其中大部分是由于在多个 C 文件中定义的变量引起的,因此要修复它们,只需在标头中声明变量 extern 并在其中一个 C 文件中定义它们。如果您没有 SD 支持,还有一些未定义的定义,但由于 LCD 菜单想要显示 SD 相关的东西而出错,即使它不受支持。

无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

哇谢谢 !等不及你的差异了!

无法使用 Makefile 使用 LCD 构建 #269

嗯,我刚刚检查了最新的 Arduino IDE(只需在其中打开 Marlin.pde),它编译得非常好。你能测试一下并告诉我你是否仍然有错误吗?或者您是否出于某种原因需要 Makefile/命令行方法?

无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

我会尝试 IDE,但从命令行构建对我来说是理想的选择。

无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

它是用 IDE 构建的,我没有尝试上传它,因为我现在正在打印很长的内容。

你能发布你的补丁吗?如有必要,我愿意清理它,以便它可以包含在主分支中。至少,它会让我使用它。

无法使用 Makefile 使用 LCD 构建 #269

我不确定在此处放置补丁的最佳方式是什么(之前从未使用过 GitHub),所以我将它放在我的评论中。请注意,我使用的是 jcrocholl 的 Marlin 分支(也在 GitHub 上),因此可能有一些细节与 ErikZalm 的文件不同。

让我知道我是否遗漏了什么,只是快速检查了差异。开始了:

diff -u old/EEPROMwrite.h new/EEPROMwrite.h
--- old/EEPROMwrite.h     2012-11-05 01:48:08.977100989 +0100
+++ new/EEPROMwrite.h  2012-10-31 23:58:08.833013870 +0100
@@ -6,13 +6,13 @@
 #include "temperature.h"
 //#include <EEPROM.h>

-int plaPreheatHotendTemp;
-int plaPreheatHPBTemp;
-int plaPreheatFanSpeed;
-
-int absPreheatHotendTemp;
-int absPreheatHPBTemp;
-int absPreheatFanSpeed;
+extern int plaPreheatHotendTemp;
+extern int plaPreheatHPBTemp;
+extern int plaPreheatFanSpeed;
+
+extern int absPreheatHotendTemp;
+extern int absPreheatHPBTemp;
+extern int absPreheatFanSpeed;

diff -u old/Makefile new/Makefile
--- old/Makefile  2012-11-05 01:48:08.981100998 +0100
+++ new/Makefile       2012-11-02 18:57:23.579199782 +0100
@@ -66,8 +66,9 @@
 F_CPU = 16000000

 UPLOAD_RATE = 115200
+AVRDUDE_PROGRAMMER = stk500v2
@@ -93,8 +95,8 @@
        Marlin.cpp MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp \
        SdFatUtil.cpp SdFile.cpp SdVolume.cpp motion_control.cpp \
        planner.cpp stepper.cpp temperature.cpp cardreader.cpp
-#CXXSRC += LiquidCrystal.cpp ultralcd.cpp
-#CXXSRC += ultralcd.cpp
+CXXSRC += LiquidCrystal.cpp
+CXXSRC += ultralcd.cpp
@@ -133,16 +135,19 @@

 CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
 CXXFLAGS =         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
 LDFLAGS = -lm


 # Programming support using avrdude. Settings and variables.
 AVRDUDE_PORT = $(PORT)
 AVRDUDE_WRITE_FLASH = -U flash:w:applet/$(TARGET).hex:i
-AVRDUDE_FLAGS = -D -C $(INSTALL_DIR)/hardware/tools/avrdude.conf \
+#Use Arduino 1.0.1 programmer & config files here. It's probably not needed.
+AVRDUDE_FLAGS = -v -v -v -v -D -C $(INSTALL_DIR)/../current/hardware/tools/avrdude.conf \
        -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
-       -b $(UPLOAD_RATE)
+       -b $(UPLOAD_RATE) -F
@@ -202,24 +207,34 @@
        $P echo '#include "$<"' >>$@
        $P echo '#include "$(ARDUINO)/main.cpp"' >> $@

+applet/ultralcd.cpp: ultralcd.pde $(MAKEFILE)
+# Here is the "preprocessing".
+# It creates a .cpp file based with the same name as the .pde file.
+# On top of the new .cpp file comes the WProgram.h header.
+       $(Pecho) "  WR    $@"
+       $P echo '#include "WProgram.h"' > $@
+       $P echo '#include "$<"' >>$@
+
 elf: applet/$(TARGET).elf
 hex: applet/$(TARGET).hex
 eep: applet/$(TARGET).eep
 lss: applet/$(TARGET).lss
 sym: applet/$(TARGET).sym

 # Program the device.
 # Do not try to reset an arduino if it's not one
 upload: applet/$(TARGET).hex
-ifeq (${AVRDUDE_PROGRAMMER}, arduino)
+#ifeq (${AVRDUDE_PROGRAMMER}, arduino)
+ifeq (${AVRDUDE_PROGRAMMER}, stk500v2)
        stty hup < $(PORT); true
 endif
        $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
-ifeq (${AVRDUDE_PROGRAMMER}, arduino)
+#ifeq (${AVRDUDE_PROGRAMMER}, arduino)
+ifeq (${AVRDUDE_PROGRAMMER}, stk500v2)
        stty -hup < $(PORT); true
 endif
@@ -277,6 +292,10 @@
        $(Pecho) "  CC    $@"
        $P $(CC) -MMD -c $(ALL_CFLAGS) $< -o $@

+applet/%.o: applet/%.cpp Configuration.h Configuration_adv.h $(MAKEFILE)
+       $(Pecho) "  CXX   $@"
+       $P $(CXX) -MMD -c $(ALL_CXXFLAGS) $< -o $@
+
无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

谢谢 !这周我会仔细看看。我不明白 IDE 使用这些声明两次或未声明为 extern 的变量正确构建 Marlin 的机制。

无法使用 Makefile 使用 LCD 构建 #269

我没有检查IDE是如何编译的,但是如果它是通过
一次编译所有文件来编译的,那么就不会出现这个变量声明问题。
2012 年 11 月 5 日凌晨 4:59,“Jonathan Bastien-Filiatrault”<
notifications@github.com > 写道:

谢谢 !这周我会仔细看看。我不明白
IDE 使用这些
声明两次或未声明为 extern 的变量正确构建 Marlin 的机制。


直接回复此电子邮件或在 GitHub 上查看它 https://github.com/ErikZalm/Marlin/issues/269#issuecomment-10060064。

无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

好的,今晚我将测试它连接源文件并一次编译的理论,我猜那里有一个冗长的模式。

无法使用 Makefile 使用 LCD 构建 #269
贡献者作者

你能用三重反引号““`”引用你的差异吗?

再次感谢 !

无法使用 Makefile 使用 LCD 构建 #269
贡献者

Arduino 把所有的 PDE 文件一个接一个地抓起来(这很愚蠢)。但我正在努力使 Marlin 仅包含 .cpp 和 .h 文件。这使得使用其他 IDE 和 Makefile 进行编译变得更加容易。

喜欢 (0)