extern int not working

Hi, I am trying to upload code to a 3d printer but keep on getting error messages here is the code that is having problems THere error simply is Error compiling

#ifdef ULTRA_LCD

  void lcd_update();
  void lcd_init();
  void lcd_setstatus(const char* message);
  void lcd_setstatuspgm(const char* message);
  void lcd_setalertstatuspgm(const char* message);
  void lcd_reset_alert_level();
  bool lcd_detected(void);

#ifdef DOGLCD
  external int lcd_contrast;
  void lcd_setcontrast(uint8_t value);
#endif



  #ifdef ULTIPANEL
  void lcd_buttons_update();
  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
  #ifdef REPRAPWORLD_KEYPAD
    extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
  #endif
  #else
  FORCE_INLINE void lcd_buttons_update() {}
  #endif

  extern int plaPreheatHotendTemp;
  extern int plaPreheatHPBTemp;
  extern int plaPreheatFanSpeed;

  extern int absPreheatHotendTemp;
  extern int absPreheatHPBTemp;
  extern int absPreheatFanSpeed;
  
  extern bool cancel_heatup;
  
  #ifdef FILAMENT_LCD_DISPLAY
        extern unsigned long message_millis;
  #endif

i will post the whole libary and error message below

the error message

Marlin\ultralcd.cpp.o: In function `lcd_setstatuspgm(char const*)':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:1316: multiple definition of `lcd_setstatuspgm(char const*)'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:1316: first defined here
Marlin\ultralcd.cpp.o: In function `lcd_setalertstatuspgm(char const*)':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:1323: multiple definition of `lcd_setalertstatuspgm(char const*)'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:1323: first defined here
Marlin\ultralcd.cpp.o: In function `lcd_setstatus(char const*)':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:1309: multiple definition of `lcd_setstatus(char const*)'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:1309: first defined here
Marlin\ultralcd.cpp.o: In function `lcd_update()':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:1178: multiple definition of `lcd_update()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:1178: first defined here
Marlin\ultralcd.cpp.o:(.bss.lcd_oldcardstatus+0x0): multiple definition of `lcd_oldcardstatus'
ultralcd.cpp.o:(.bss.lcd_oldcardstatus+0x0): first defined here
Marlin\ultralcd.cpp.o:(.bss.lcd_next_update_millis+0x0): multiple definition of `lcd_next_update_millis'
ultralcd.cpp.o:(.bss.lcd_next_update_millis+0x0): first defined here
Marlin\ultralcd.cpp.o: In function `lcd_init()':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:1125: multiple definition of `lcd_init()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:1125: first defined here
Marlin\ultralcd.cpp.o: In function `setTargetBed':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:548: multiple definition of `lcd_preheat_abs_bedonly()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:548: first defined here
Marlin\ultralcd.cpp.o: In function `setTargetBed':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:540: multiple definition of `lcd_preheat_pla_bedonly()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:540: first defined here
Marlin\ultralcd.cpp.o: In function `setTargetHotend':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:467: multiple definition of `lcd_preheat_abs0()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:467: first defined here
Marlin\ultralcd.cpp.o: In function `setTargetHotend':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:458: multiple definition of `lcd_preheat_pla0()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:458: first defined here
Marlin\ultralcd.cpp.o: In function `lcd_set_home_offsets()':
C:\Users\**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin/ultralcd.cpp:384: multiple definition of `lcd_set_home_offsets()'
ultralcd.cpp.o:C:\Users\**~1\AppData\Local\Temp\build7821638072748569750.tmp/ultralcd.cpp:384: first defined here

here is the full libary

#ifndef ULTRALCD_H
#define ULTRALCD_H

#include "Marlin.h"

#ifdef ULTRA_LCD

  void lcd_update();
  void lcd_init();
  void lcd_setstatus(const char* message);
  void lcd_setstatuspgm(const char* message);
  void lcd_setalertstatuspgm(const char* message);
  void lcd_reset_alert_level();
  bool lcd_detected(void);

#ifdef DOGLCD
  external int lcd_contrast;
  void lcd_setcontrast(uint8_t value);
#endif

  static unsigned char blink = 0; // Variable for visualization of fan rotation in GLCD

  #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
  #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))

  #define LCD_UPDATE_INTERVAL 100
  #define LCD_TIMEOUT_TO_STATUS 15000

  #ifdef ULTIPANEL
  void lcd_buttons_update();
  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
  #ifdef REPRAPWORLD_KEYPAD
    extern volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
  #endif
  #else
  FORCE_INLINE void lcd_buttons_update() {}
  #endif

  extern int plaPreheatHotendTemp;
  extern int plaPreheatHPBTemp;
  extern int plaPreheatFanSpeed;

  extern int absPreheatHotendTemp;
  extern int absPreheatHPBTemp;
  extern int absPreheatFanSpeed;
  
  extern bool cancel_heatup;
  
  #ifdef FILAMENT_LCD_DISPLAY
        extern unsigned long message_millis;
  #endif
    
  void lcd_buzz(long duration,uint16_t freq);
  bool lcd_clicked();

  void lcd_ignore_click(bool b=true);

  #ifdef NEWPANEL
    #define EN_C (1<<BLEN_C)
    #define EN_B (1<<BLEN_B)
    #define EN_A (1<<BLEN_A)

    #define LCD_CLICKED (buttons&EN_C)
    #ifdef REPRAPWORLD_KEYPAD
    #define EN_REPRAPWORLD_KEYPAD_F3 (1<<BLEN_REPRAPWORLD_KEYPAD_F3)
    #define EN_REPRAPWORLD_KEYPAD_F2 (1<<BLEN_REPRAPWORLD_KEYPAD_F2)
    #define EN_REPRAPWORLD_KEYPAD_F1 (1<<BLEN_REPRAPWORLD_KEYPAD_F1)
    #define EN_REPRAPWORLD_KEYPAD_UP (1<<BLEN_REPRAPWORLD_KEYPAD_UP)
    #define EN_REPRAPWORLD_KEYPAD_RIGHT (1<<BLEN_REPRAPWORLD_KEYPAD_RIGHT)
    #define EN_REPRAPWORLD_KEYPAD_MIDDLE (1<<BLEN_REPRAPWORLD_KEYPAD_MIDDLE)
    #define EN_REPRAPWORLD_KEYPAD_DOWN (1<<BLEN_REPRAPWORLD_KEYPAD_DOWN)
    #define EN_REPRAPWORLD_KEYPAD_LEFT (1<<BLEN_REPRAPWORLD_KEYPAD_LEFT)

    #define LCD_CLICKED ((buttons&EN_C) || (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F1))
    #define REPRAPWORLD_KEYPAD_MOVE_Z_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F2)
    #define REPRAPWORLD_KEYPAD_MOVE_Z_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_F3)
    #define REPRAPWORLD_KEYPAD_MOVE_X_LEFT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_LEFT)
    #define REPRAPWORLD_KEYPAD_MOVE_X_RIGHT (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_RIGHT)
    #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_DOWN)
    #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_UP)
    #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons_reprapworld_keypad&EN_REPRAPWORLD_KEYPAD_MIDDLE)
    #endif //REPRAPWORLD_KEYPAD
  #else
    //atomic, do not change
    #define B_LE (1<<BL_LE)
    #define B_UP (1<<BL_UP)
    #define B_MI (1<<BL_MI)
    #define B_DW (1<<BL_DW)
    #define B_RI (1<<BL_RI)
    #define B_ST (1<<BL_ST)
    #define EN_B (1<<BLEN_B)
    #define EN_A (1<<BLEN_A)
    
    #define LCD_CLICKED ((buttons&B_MI)||(buttons&B_ST))
  #endif//NEWPANEL

#else //no LCD
  FORCE_INLINE void lcd_update() {}
  FORCE_INLINE void lcd_init() {}
  FORCE_INLINE void lcd_setstatus(const char* message) {}
  FORCE_INLINE void lcd_buttons_update() {}
  FORCE_INLINE void lcd_reset_alert_level() {}
  FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
  FORCE_INLINE bool lcd_detected(void) { return true; }

  #define LCD_MESSAGEPGM(x) 
  #define LCD_ALERTMESSAGEPGM(x) 

#endif //ULTRA_LCD

char *itostr2(const uint8_t &x);
char *itostr31(const int &xx);
char *itostr3(const int &xx);
char *itostr3left(const int &xx);
char *itostr4(const int &xx);

char *ftostr3(const float &x);
char *ftostr31ns(const float &x); // float to string without sign character
char *ftostr31(const float &x);
char *ftostr32(const float &x);
char *ftostr43(const float &x);
char *ftostr12ns(const float &x); 
char *ftostr32sp(const float &x); // remove zero-padding from ftostr32
char *ftostr5(const float &x);
char *ftostr51(const float &x);
char *ftostr52(const float &x);

#endif //ULTRALCD_H

I am trying to upload code to a 3d printer

You do know that this is a forum for the Arduino and related products, not for 3D printers?

PerryBebbington: You do know that this is a forum for the Arduino and related products, not for 3D printers?

its using the arduino ide

Marlin isn't a library. Marlin is a sketch. I suspect the problem might be caused by you installing Marlin at C:\Users**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin. You should only put libraries there, not sketches.

I'm also very curious as to why you're using the extremely outdated Arduino IDE 1.0.1. Are you also using an extremely outdated version of Marlin?

It's not clear to me what these files you posted are.

Are you following some tutorial or instructions? If so, post a link to them.

We would definitely need a lot more information in order to help you.

pert: Marlin isn't a library. Marlin is a sketch. I suspect the problem might be caused by you installing Marlin at C:\Users**\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\Marlin. You should only put libraries there, not sketches.

I'm also very curious as to why you're using the extremely outdated Arduino IDE 1.0.1. Are you also using an extremely outdated version of Marlin?

It's not clear to me what these files you posted are.

Are you following some tutorial or instructions? If so, post a link to them. the printer i the i3 pro x We would definitely need a lot more information in order to help you.

this is the source http://www.geeetech.com/forum/viewtopic.php?f=13&t=17181

Current versions of Marlin will build ONLY with current versions of the Arduino IDE. The version requirements are clearly spelled out in the Marlin repository.

Regards, Ray L.

lorenzo0306: this is the source http://www.geeetech.com/forum/viewtopic.php?f=13&t=17181

And which printer are you trying to re-install the firmware for?

johnwasser: And which printer are you trying to re-install the firmware for?

prusa i3 pro x

RayLivingston: Current versions of Marlin will build ONLY with current versions of the Arduino IDE. The version requirements are clearly spelled out in the Marlin repository.

Regards, Ray L.

they newer versions of marlin does not work with my printer

lorenzo0306: the newer version of marlin does not work with my printer

Then why do they provide Marlin/example_configurations/Geeetech/i3_Pro_X-GT2560 with the latest version of Marlin?

johnwasser: Then why do they provide Marlin/example_configurations/Geeetech/i3_Pro_X-GT2560 with the latest version of Marlin?

thats the one im using

lorenzo0306: thats the one im using

I'm confused. You said that "they newer versions of marlin does not work with my printer" and when I pointed out that they do, you say "that's the one im using". I don't understand.

Arduino 1.0.1 was written in 2012. There have been lots of improvements in Marlin since then. If it were MY printer I would use the latest version of Marlin rather than using the old version that Geeetech is too lazy to update.

im using the one that says I3_Pro_X.zip. the code doesnt work at all in the newer arduino versions and the newer versions of marlin dont work wih my printer

lorenzo0306:
the newer versions of marlin dont work wih my printer

See reply #11. And then reply #14.

im using this libary which one are you

I3_pro_X.zip (296 KB)

lorenzo0306: im using this libary which one are you

WARNING: Marlin is NOT a library.

  • Starting at http://marlinfw.org/meta/download/ I downloaded the latest version of Marlin: https://github.com/MarlinFirmware/Marlin/archive/bugfix-1.1.x.zip
  • I unpacked the .zip file. DO NOT INSTALL IT AS A LIBRARY.
  • I moved the bugfix-1.1x/Marlin folder to my sketch folder. DO NOT INSTALL IT AS A LIBRARY.
  • I replaced the Marlin/Configuration.h file with the Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h file.
  • I opened the sketch Marlin/Marlin.ino in the Arduino 1.8.9 IDE.
  • I selected Tools->Board: "Arduino/Genuino Mega or Mega 2560"

The sketch compiles without errors or warnings