There’s a problem when we try to install lpc2k_pgm 1.05 flasher when we have GTK+ 2.0 (Ubuntu uses it as default in new versions – 9.10 , 10.4) because it try to use GTK+ 1.2. So then, one option is patch the Makefile, specifying to use GTK+ 2.0, and forget to install GTK+ 1.2.
And the steps are:
apt-get install libgtk2.0-dev
wget http://www.pjrc.com/arm/lpc2k_pgm/lpc2k_pgm_1.05.tar.gz
tar xzf lpc2k_pgm_1.05.tar.gz
cd lpc2k_pgm
wget http://lexo.lx-networks.net/lpc2k_pgm.patch
patch -p1 < lpc2k_pgm.patch
make
And that's all! now you're ready to flash
Note: Don't forget that you need the GTK+ 2.0
ERROR REFERENCE
gcc -Wall -O2 -c -o lpc2k_pgm.o lpc2k_pgm.c
gcc -Wall -O2 `gtk-config --cflags` -c gui.c
/bin/sh: gtk-config: not found
gui.c:40:21: error: gtk/gtk.h: No such file or directory
gui.c:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
gui.c:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
gui.c:53: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
gui.c:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
gui.c:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
gui.c:56: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
gui.c:62: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_quit’
gui.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_program’
gui.c: In function ‘done_program’:
gui.c:98: warning: implicit declaration of function ‘gtk_entry_get_text’
gui.c:98: warning: implicit declaration of function ‘GTK_ENTRY’
gui.c:98: error: ‘firmware_entry’ undeclared (first use in this function)
gui.c:98: error: (Each undeclared identifier is reported only once
gui.c:98: error: for each function it appears in.)
gui.c:98: warning: passing argument 1 of ‘file_exists’ makes pointer from integer without a cast
gui.c:83: note: expected ‘const char *’ but argument is of type ‘int’
gui.c:99: warning: implicit declaration of function ‘gtk_widget_set_sensitive’
gui.c:99: error: ‘program_button’ undeclared (first use in this function)
gui.c:99: error: ‘TRUE’ undeclared (first use in this function)
gui.c:101: error: ‘FALSE’ undeclared (first use in this function)
gui.c:103: error: ‘bootloader_button’ undeclared (first use in this function)
gui.c:104: error: ‘reboot_button’ undeclared (first use in this function)
gui.c: At top level:
gui.c:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_reboot’
gui.c:134: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_bootloader’
gui.c:155: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_new_port’
gui.c:161: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_new_baud’
gui.c:167: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_new_file’
gui.c:185: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_new_crystal’
gui.c:195: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘do_timer’
gui.c:210: error: expected ‘)’ before ‘data’
gui.c:228: error: expected ‘)’ before ‘data’
gui.c: In function ‘run_gui’:
gui.c:246: warning: implicit declaration of function ‘gtk_signal_connect’
gui.c:246: warning: implicit declaration of function ‘GTK_OBJECT’
gui.c:246: error: ‘main_window’ undeclared (first use in this function)
gui.c:247: warning: implicit declaration of function ‘GTK_SIGNAL_FUNC’
gui.c:247: error: ‘do_quit’ undeclared (first use in this function)
gui.c:248: error: ‘quit_button’ undeclared (first use in this function)
gui.c:250: error: ‘port_entry’ undeclared (first use in this function)
gui.c:251: error: ‘do_new_port’ undeclared (first use in this function)
gui.c:252: warning: implicit declaration of function ‘GTK_COMBO’
gui.c:252: error: ‘baud_combo’ undeclared (first use in this function)
gui.c:252: error: invalid type argument of ‘->’ (have ‘int’)
gui.c:253: error: ‘do_new_baud’ undeclared (first use in this function)
gui.c:254: error: ‘firmware_entry’ undeclared (first use in this function)
gui.c:255: error: ‘do_new_file’ undeclared (first use in this function)
gui.c:256: error: ‘crystal_entry’ undeclared (first use in this function)
gui.c:257: error: ‘do_new_crystal’ undeclared (first use in this function)
gui.c:258: error: ‘program_button’ undeclared (first use in this function)
gui.c:259: error: ‘do_program’ undeclared (first use in this function)
gui.c:260: error: ‘reboot_button’ undeclared (first use in this function)
gui.c:261: error: ‘do_reboot’ undeclared (first use in this function)
gui.c:262: error: ‘bootloader_button’ undeclared (first use in this function)
gui.c:263: error: ‘do_bootloader’ undeclared (first use in this function)
gui.c:265: warning: implicit declaration of function ‘gtk_timeout_add’
gui.c:265: error: ‘do_timer’ undeclared (first use in this function)
gui.c:266: warning: implicit declaration of function ‘gdk_input_add’
gui.c:266: error: ‘GDK_INPUT_READ’ undeclared (first use in this function)
gui.c:266: error: ‘do_term_input’ undeclared (first use in this function)
gui.c:267: error: ‘do_port_input’ undeclared (first use in this function)
gui.c:269: warning: implicit declaration of function ‘gtk_main’
gui.c: In function ‘create_window’:
gui.c:275: error: ‘GList’ undeclared (first use in this function)
gui.c:275: error: ‘gtk_baud_list’ undeclared (first use in this function)
gui.c:278: warning: implicit declaration of function ‘gtk_init’
gui.c:280: error: ‘firmware_label’ undeclared (first use in this function)
gui.c:280: warning: implicit declaration of function ‘gtk_label_new’
gui.c:281: warning: implicit declaration of function ‘gtk_label_set_justify’
gui.c:281: warning: implicit declaration of function ‘GTK_LABEL’
gui.c:281: error: ‘GTK_JUSTIFY_RIGHT’ undeclared (first use in this function)
gui.c:282: warning: implicit declaration of function ‘gtk_widget_show’
gui.c:284: error: ‘firmware_entry’ undeclared (first use in this function)
gui.c:284: warning: implicit declaration of function ‘gtk_entry_new’
gui.c:285: warning: implicit declaration of function ‘gtk_widget_set_usize’
gui.c:286: warning: implicit declaration of function ‘gtk_entry_set_text’
gui.c:289: error: ‘program_button’ undeclared (first use in this function)
gui.c:289: warning: implicit declaration of function ‘gtk_button_new_with_label’
gui.c:291: error: ‘TRUE’ undeclared (first use in this function)
gui.c:293: error: ‘FALSE’ undeclared (first use in this function)
gui.c:297: error: ‘line1_hbox’ undeclared (first use in this function)
gui.c:297: warning: implicit declaration of function ‘gtk_hbox_new’
gui.c:298: warning: implicit declaration of function ‘gtk_box_pack_start’
gui.c:298: warning: implicit declaration of function ‘GTK_BOX’
gui.c:304: error: ‘port_label’ undeclared (first use in this function)
gui.c:308: error: ‘port_entry’ undeclared (first use in this function)
gui.c:314: error: ‘baud_label’ undeclared (first use in this function)
gui.c:318: error: ‘baud_combo’ undeclared (first use in this function)
gui.c:318: warning: implicit declaration of function ‘gtk_combo_new’
gui.c:320: warning: implicit declaration of function ‘g_list_append’
gui.c:322: warning: implicit declaration of function ‘gtk_combo_set_popdown_strings’
gui.c:323: warning: implicit declaration of function ‘gtk_entry_set_editable’
gui.c:323: error: invalid type argument of ‘->’ (have ‘int’)
gui.c:327: warning: implicit declaration of function ‘gtk_list_select_item’
gui.c:327: warning: implicit declaration of function ‘GTK_LIST’
gui.c:327: error: invalid type argument of ‘->’ (have ‘int’)
gui.c:333: error: ‘line2_hbox’ undeclared (first use in this function)
gui.c:341: error: ‘crystal_label’ undeclared (first use in this function)
gui.c:345: error: ‘crystal_entry’ undeclared (first use in this function)
gui.c:350: error: ‘mhz_label’ undeclared (first use in this function)
gui.c:351: error: ‘GTK_JUSTIFY_LEFT’ undeclared (first use in this function)
gui.c:354: error: ‘line3_hbox’ undeclared (first use in this function)
gui.c:361: error: ‘reboot_button’ undeclared (first use in this function)
gui.c:365: error: ‘bootloader_button’ undeclared (first use in this function)
gui.c:368: error: ‘quit_button’ undeclared (first use in this function)
gui.c:371: error: ‘line4_hbox’ undeclared (first use in this function)
gui.c:377: error: ‘main_vbox’ undeclared (first use in this function)
gui.c:377: warning: implicit declaration of function ‘gtk_vbox_new’
gui.c:384: error: ‘main_window’ undeclared (first use in this function)
gui.c:384: warning: implicit declaration of function ‘gtk_window_new’
gui.c:384: error: ‘GTK_WINDOW_TOPLEVEL’ undeclared (first use in this function)
gui.c:385: warning: implicit declaration of function ‘gtk_container_add’
gui.c:385: warning: implicit declaration of function ‘GTK_CONTAINER’
make: *** [gui.o] Error 1
