2013年2月21日 星期四

git push到gerrit review server的方法與設定

假設 git project 的 url 為
   ssh://Gerrit_SERVER/Project-A

當 git clone下來後
  git clone ssh://Gerrit_SERVER/Project-A
  // 設定 review 
  git config remote.review.pushurl ssh://Gerrit_SERVER/Project-A
  git config remote.review.push refs/heads/*:refs/for/*
  // 設定bypass review
  git config remote.noreview.pushurl ssh://Gerrit_SERVER/Project-A
  git config remote.noreview.push refs/heads/*

之後當commit 之後 如果要push  進 review
  git push review

如果要 bypass review的話
  git push noreview



filter svn log by username


svn log | sed -n '/username/,/-----$/ p'


2013年2月18日 星期一

untar without its first directory

舉例來說 如果有一個tar 檔為 123.tar.bz2 其內部有 
         abc/ 
         abc/123.txt 
         456.bin
 如果我用這樣的指令去解開它 tar -xjv -f 123.tar.bz2  
 這時候解開的結構會是
 123/
      |-abc
      |---123.txt
      |-456.bin

 如果想要讓解開的結構不包含第一個directory 123
 那可以用以下方法
 
   tar -xjv -f 123.tar.bz2 --strip 1


2013年2月7日 星期四

make menuconfig failed

今天試著想要在自己的ubuntu系統上下make menuconfig來設定kernel的configuration 但卻發生failed的情況, 一大串error message如下, 針對這個錯誤的解決方式為

$ sudo apt-get install lib32ncurses5-dev




HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf.o: In function `main':
mconf.c:(.text.startup+0x66): undefined reference to `initscr'
mconf.c:(.text.startup+0x6d): undefined reference to `stdscr'
scripts/kconfig/lxdialog/checklist.o: In function `print_arrows':
checklist.c:(.text+0x41): undefined reference to `wmove'
checklist.c:(.text+0x61): undefined reference to `acs_map'
checklist.c:(.text+0x69): undefined reference to `waddch'
checklist.c:(.text+0x7b): undefined reference to `waddnstr'
checklist.c:(.text+0x8c): undefined reference to `wmove'
checklist.c:(.text+0xb3): undefined reference to `acs_map'
checklist.c:(.text+0xbb): undefined reference to `waddch'
checklist.c:(.text+0x10b): undefined reference to `acs_map'
checklist.c:(.text+0x113): undefined reference to `waddch'
checklist.c:(.text+0x11a): undefined reference to `acs_map'
checklist.c:(.text+0x122): undefined reference to `waddch'
checklist.c:(.text+0x129): undefined reference to `acs_map'
checklist.c:(.text+0x131): undefined reference to `waddch'
checklist.c:(.text+0x138): undefined reference to `acs_map'
checklist.c:(.text+0x183): undefined reference to `acs_map'
checklist.c:(.text+0x18b): undefined reference to `waddch'
checklist.c:(.text+0x192): undefined reference to `acs_map'
checklist.c:(.text+0x19a): undefined reference to `waddch'
checklist.c:(.text+0x1a1): undefined reference to `acs_map'
checklist.c:(.text+0x1a9): undefined reference to `waddch'
checklist.c:(.text+0x1b0): undefined reference to `acs_map'
checklist.c:(.text+0x1b8): undefined reference to `waddch'
scripts/kconfig/lxdialog/checklist.o: In function `print_item':
checklist.c:(.text+0x1fb): undefined reference to `wmove'
checklist.c:(.text+0x21d): undefined reference to `waddch'
checklist.c:(.text+0x237): undefined reference to `wmove'
checklist.c:(.text+0x28e): undefined reference to `wmove'
checklist.c:(.text+0x2a4): undefined reference to `waddch'
checklist.c:(.text+0x2d4): undefined reference to `waddnstr'
checklist.c:(.text+0x300): undefined reference to `wmove'
checklist.c:(.text+0x340): undefined reference to `wprintw'
scripts/kconfig/lxdialog/checklist.o: In function `print_buttons':
checklist.c:(.text+0x3e9): undefined reference to `wmove'
scripts/kconfig/lxdialog/checklist.o: In function `dialog_checklist':
checklist.c:(.text+0x4e7): undefined reference to `stdscr'
checklist.c:(.text+0x539): undefined reference to `COLS'
checklist.c:(.text+0x54d): undefined reference to `stdscr'
checklist.c:(.text+0x55d): undefined reference to `LINES'
checklist.c:(.text+0x58f): undefined reference to `newwin'
checklist.c:(.text+0x59f): undefined reference to `keypad'
checklist.c:(.text+0x5e4): undefined reference to `wmove'
checklist.c:(.text+0x5f0): undefined reference to `acs_map'
checklist.c:(.text+0x5f8): undefined reference to `waddch'
checklist.c:(.text+0x623): undefined reference to `acs_map'
checklist.c:(.text+0x62e): undefined reference to `waddch'
checklist.c:(.text+0x660): undefined reference to `acs_map'
checklist.c:(.text+0x665): undefined reference to `waddch'
checklist.c:(.text+0x6c3): undefined reference to `subwin'
checklist.c:(.text+0x6d5): undefined reference to `keypad'
checklist.c:(.text+0x859): undefined reference to `wnoutrefresh'
checklist.c:(.text+0x863): undefined reference to `wnoutrefresh'
checklist.c:(.text+0x868): undefined reference to `doupdate'
checklist.c:(.text+0x889): undefined reference to `wgetch'
checklist.c:(.text+0x9b9): undefined reference to `doupdate'
checklist.c:(.text+0x9d1): undefined reference to `delwin'
checklist.c:(.text+0x9d9): undefined reference to `delwin'
checklist.c:(.text+0xa39): undefined reference to `scrollok'
checklist.c:(.text+0xa48): undefined reference to `wscrl'
checklist.c:(.text+0xa54): undefined reference to `scrollok'
checklist.c:(.text+0xaa8): undefined reference to `wnoutrefresh'
checklist.c:(.text+0xab2): undefined reference to `wrefresh'
checklist.c:(.text+0xb2d): undefined reference to `wnoutrefresh'
checklist.c:(.text+0xb37): undefined reference to `wrefresh'
checklist.c:(.text+0xbd2): undefined reference to `delwin'
checklist.c:(.text+0xbda): undefined reference to `delwin'
checklist.c:(.text+0xc39): undefined reference to `scrollok'
checklist.c:(.text+0xc48): undefined reference to `wscrl'
checklist.c:(.text+0xc54): undefined reference to `scrollok'
checklist.c:(.text+0xcaf): undefined reference to `wnoutrefresh'
checklist.c:(.text+0xcb9): undefined reference to `wrefresh'
checklist.c:(.text+0xcda): undefined reference to `doupdate'
checklist.c:(.text+0xd10): undefined reference to `delwin'
checklist.c:(.text+0xd18): undefined reference to `delwin'
checklist.c:(.text+0xdb9): undefined reference to `wrefresh'
checklist.c:(.text+0xdbe): undefined reference to `doupdate'
checklist.c:(.text+0xdd4): undefined reference to `doupdate'
checklist.c:(.text+0xdec): undefined reference to `doupdate'
checklist.c:(.text+0xdf8): undefined reference to `acs_map'
checklist.c:(.text+0xdff): undefined reference to `waddch'
scripts/kconfig/lxdialog/checklist.o: In function `print_arrows':
checklist.c:(.text+0xef): undefined reference to `waddnstr'
checklist.c:(.text+0x162): undefined reference to `waddch'
scripts/kconfig/lxdialog/checklist.o: In function `print_item':
checklist.c:(.text+0x312): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/checklist.o: In function `print_buttons':
checklist.c:(.text+0x409): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/util.o: In function `init_one_color':
util.c:(.text+0x46f): undefined reference to `init_pair'
scripts/kconfig/lxdialog/util.o: In function `attr_clear':
util.c:(.text+0x4d1): undefined reference to `wmove'
util.c:(.text+0x4ed): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `dialog_clear':
util.c:(.text+0x539): undefined reference to `COLS'
util.c:(.text+0x53f): undefined reference to `LINES'
util.c:(.text+0x546): undefined reference to `stdscr'
util.c:(.text+0x561): undefined reference to `stdscr'
util.c:(.text+0x57d): undefined reference to `wmove'
util.c:(.text+0x590): undefined reference to `stdscr'
util.c:(.text+0x59a): undefined reference to `waddnstr'
util.c:(.text+0x5a1): undefined reference to `stdscr'
util.c:(.text+0x5b0): undefined reference to `wmove'
util.c:(.text+0x5b6): undefined reference to `COLS'
util.c:(.text+0x5cb): undefined reference to `acs_map'
util.c:(.text+0x5d2): undefined reference to `stdscr'
util.c:(.text+0x5da): undefined reference to `waddch'
util.c:(.text+0x5e0): undefined reference to `COLS'
util.c:(.text+0x5ef): undefined reference to `stdscr'
scripts/kconfig/lxdialog/util.o: In function `init_dialog':
util.c:(.text+0x605): undefined reference to `initscr'
util.c:(.text+0x60c): undefined reference to `stdscr'
util.c:(.text+0x7f3): undefined reference to `stdscr'
util.c:(.text+0x7fd): undefined reference to `keypad'
util.c:(.text+0x802): undefined reference to `cbreak'
util.c:(.text+0x807): undefined reference to `noecho'
util.c:(.text+0x826): undefined reference to `has_colors'
util.c:(.text+0x833): undefined reference to `start_color'
util.c:(.text+0xce1): undefined reference to `endwin'
scripts/kconfig/lxdialog/util.o: In function `end_dialog':
util.c:(.text+0xd09): undefined reference to `stdscr'
util.c:(.text+0xd0e): undefined reference to `wmove'
util.c:(.text+0xd15): undefined reference to `stdscr'
util.c:(.text+0xd1a): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/util.o: In function `print_title':
util.c:(.text+0xd9a): undefined reference to `wmove'
util.c:(.text+0xdac): undefined reference to `waddch'
util.c:(.text+0xdb9): undefined reference to `wmove'
util.c:(.text+0xdcb): undefined reference to `waddnstr'
scripts/kconfig/lxdialog/util.o: In function `print_autowrap':
util.c:(.text+0xfbd): undefined reference to `wmove'
util.c:(.text+0xfcd): undefined reference to `waddnstr'
util.c:(.text+0x107e): undefined reference to `wmove'
util.c:(.text+0x108e): undefined reference to `waddnstr'
scripts/kconfig/lxdialog/util.o: In function `print_button':
util.c:(.text+0x10c3): undefined reference to `wmove'
util.c:(.text+0x10f0): undefined reference to `waddnstr'
util.c:(.text+0x1154): undefined reference to `waddch'
util.c:(.text+0x1183): undefined reference to `waddch'
util.c:(.text+0x11a4): undefined reference to `waddnstr'
util.c:(.text+0x11c1): undefined reference to `waddnstr'
util.c:(.text+0x1200): undefined reference to `waddch'
util.c:(.text+0x1221): undefined reference to `waddnstr'
util.c:(.text+0x123c): undefined reference to `waddch'
util.c:(.text+0x1251): undefined reference to `waddnstr'
scripts/kconfig/lxdialog/util.o: In function `draw_box':
util.c:(.text+0x12e4): undefined reference to `wmove'
util.c:(.text+0x1353): undefined reference to `waddch'
util.c:(.text+0x1374): undefined reference to `acs_map'
util.c:(.text+0x137f): undefined reference to `waddch'
util.c:(.text+0x13be): undefined reference to `acs_map'
util.c:(.text+0x13c9): undefined reference to `waddch'
util.c:(.text+0x13e0): undefined reference to `acs_map'
util.c:(.text+0x13eb): undefined reference to `waddch'
util.c:(.text+0x1408): undefined reference to `acs_map'
util.c:(.text+0x1413): undefined reference to `waddch'
util.c:(.text+0x1431): undefined reference to `acs_map'
util.c:(.text+0x143c): undefined reference to `waddch'
util.c:(.text+0x1458): undefined reference to `acs_map'
util.c:(.text+0x1463): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `draw_shadow':
util.c:(.text+0x148d): undefined reference to `has_colors'
util.c:(.text+0x14b8): undefined reference to `wmove'
util.c:(.text+0x14d0): undefined reference to `winch'
util.c:(.text+0x14db): undefined reference to `waddch'
util.c:(.text+0x14f9): undefined reference to `wmove'
util.c:(.text+0x1504): undefined reference to `winch'
util.c:(.text+0x150f): undefined reference to `waddch'
util.c:(.text+0x1517): undefined reference to `winch'
util.c:(.text+0x1522): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `on_key_esc':
util.c:(.text+0x162d): undefined reference to `nodelay'
util.c:(.text+0x1637): undefined reference to `keypad'
util.c:(.text+0x163f): undefined reference to `wgetch'
util.c:(.text+0x1649): undefined reference to `wgetch'
util.c:(.text+0x1654): undefined reference to `wgetch'
util.c:(.text+0x1663): undefined reference to `nodelay'
util.c:(.text+0x1670): undefined reference to `keypad'
util.c:(.text+0x16a6): undefined reference to `ungetch'
scripts/kconfig/lxdialog/util.o: In function `attr_clear':
util.c:(.text+0x523): undefined reference to `wtouchln'
scripts/kconfig/lxdialog/util.o: In function `dialog_clear':
util.c:(.text+0x5f4): undefined reference to `wnoutrefresh'
scripts/kconfig/lxdialog/util.o: In function `end_dialog':
util.c:(.text+0xd23): undefined reference to `endwin'
scripts/kconfig/lxdialog/util.o: In function `print_title':
util.c:(.text+0xdf0): undefined reference to `waddch'
scripts/kconfig/lxdialog/util.o: In function `print_button':
util.c:(.text+0x11df): undefined reference to `wmove'
scripts/kconfig/lxdialog/util.o: In function `draw_shadow':
util.c:(.text+0x153d): undefined reference to `wnoutrefresh'
scripts/kconfig/lxdialog/inputbox.o: In function `print_buttons':
inputbox.c:(.text+0x99): undefined reference to `wmove'
scripts/kconfig/lxdialog/inputbox.o: In function `dialog_inputbox':
inputbox.c:(.text+0x128): undefined reference to `stdscr'
inputbox.c:(.text+0x164): undefined reference to `COLS'
inputbox.c:(.text+0x17c): undefined reference to `LINES'
inputbox.c:(.text+0x1a4): undefined reference to `newwin'
inputbox.c:(.text+0x1b4): undefined reference to `keypad'
inputbox.c:(.text+0x1f6): undefined reference to `wmove'
inputbox.c:(.text+0x202): undefined reference to `acs_map'
inputbox.c:(.text+0x20a): undefined reference to `waddch'
inputbox.c:(.text+0x223): undefined reference to `acs_map'
inputbox.c:(.text+0x22f): undefined reference to `waddch'
inputbox.c:(.text+0x252): undefined reference to `acs_map'
inputbox.c:(.text+0x257): undefined reference to `waddch'
inputbox.c:(.text+0x2e8): undefined reference to `wmove'
inputbox.c:(.text+0x385): undefined reference to `waddch'
inputbox.c:(.text+0x39e): undefined reference to `wmove'
inputbox.c:(.text+0x3a6): undefined reference to `wrefresh'
inputbox.c:(.text+0x3b5): undefined reference to `wgetch'
inputbox.c:(.text+0x3fe): undefined reference to `delwin'
inputbox.c:(.text+0x44b): undefined reference to `delwin'
inputbox.c:(.text+0x4f8): undefined reference to `wmove'
inputbox.c:(.text+0x508): undefined reference to `waddch'
inputbox.c:(.text+0x510): undefined reference to `wrefresh'
inputbox.c:(.text+0x555): undefined reference to `delwin'
inputbox.c:(.text+0x5c7): undefined reference to `wmove'
inputbox.c:(.text+0x620): undefined reference to `waddch'
inputbox.c:(.text+0x6dc): undefined reference to `waddnstr'
inputbox.c:(.text+0x73b): undefined reference to `delwin'
inputbox.c:(.text+0x751): undefined reference to `delwin'
inputbox.c:(.text+0x795): undefined reference to `wmove'
inputbox.c:(.text+0x79d): undefined reference to `wrefresh'
inputbox.c:(.text+0x7c6): undefined reference to `acs_map'
inputbox.c:(.text+0x7cd): undefined reference to `waddch'
inputbox.c:(.text+0x844): undefined reference to `wmove'
inputbox.c:(.text+0x89d): undefined reference to `wmove'
inputbox.c:(.text+0x8a5): undefined reference to `wrefresh'
inputbox.c:(.text+0x8dc): undefined reference to `wmove'
inputbox.c:(.text+0x8ee): undefined reference to `waddch'
inputbox.c:(.text+0x8fd): undefined reference to `wmove'
inputbox.c:(.text+0x905): undefined reference to `wrefresh'
inputbox.c:(.text+0x920): undefined reference to `flash'
inputbox.c:(.text+0x93b): undefined reference to `wmove'
inputbox.c:(.text+0x974): undefined reference to `waddch'
scripts/kconfig/lxdialog/inputbox.o: In function `print_buttons':
inputbox.c:(.text+0xb9): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/textbox.o: In function `print_position':
textbox.c:(.text+0xc0): undefined reference to `wbkgdset'
textbox.c:(.text+0x105): undefined reference to `wmove'
textbox.c:(.text+0x129): undefined reference to `wbkgdset'
scripts/kconfig/lxdialog/textbox.o: In function `print_line':
textbox.c:(.text+0x290): undefined reference to `wmove'
textbox.c:(.text+0x2a0): undefined reference to `waddch'
textbox.c:(.text+0x2c1): undefined reference to `waddnstr'
scripts/kconfig/lxdialog/textbox.o: In function `refresh_text_box':
textbox.c:(.text+0x374): undefined reference to `wnoutrefresh'
textbox.c:(.text+0x38a): undefined reference to `wmove'
scripts/kconfig/lxdialog/textbox.o: In function `dialog_textbox':
textbox.c:(.text+0x3dc): undefined reference to `stdscr'
textbox.c:(.text+0x450): undefined reference to `COLS'
textbox.c:(.text+0x482): undefined reference to `LINES'
textbox.c:(.text+0x4bb): undefined reference to `newwin'
textbox.c:(.text+0x4cb): undefined reference to `keypad'
textbox.c:(.text+0x4ed): undefined reference to `subwin'
textbox.c:(.text+0x50e): undefined reference to `wbkgdset'
textbox.c:(.text+0x51b): undefined reference to `keypad'
textbox.c:(.text+0x55d): undefined reference to `wmove'
textbox.c:(.text+0x569): undefined reference to `acs_map'
textbox.c:(.text+0x571): undefined reference to `waddch'
textbox.c:(.text+0x58b): undefined reference to `acs_map'
textbox.c:(.text+0x596): undefined reference to `waddch'
textbox.c:(.text+0x5c4): undefined reference to `wbkgdset'
textbox.c:(.text+0x5cb): undefined reference to `acs_map'
textbox.c:(.text+0x5d3): undefined reference to `waddch'
textbox.c:(.text+0x621): undefined reference to `wnoutrefresh'
textbox.c:(.text+0x686): undefined reference to `wgetch'
textbox.c:(.text+0x786): undefined reference to `delwin'
textbox.c:(.text+0x78e): undefined reference to `delwin'
textbox.c:(.text+0x7e4): undefined reference to `delwin'
textbox.c:(.text+0x7ec): undefined reference to `delwin'
textbox.c:(.text+0x887): undefined reference to `scrollok'
textbox.c:(.text+0x894): undefined reference to `wscrl'
textbox.c:(.text+0x89e): undefined reference to `scrollok'
textbox.c:(.text+0x8e9): undefined reference to `wnoutrefresh'
textbox.c:(.text+0x9fb): undefined reference to `scrollok'
textbox.c:(.text+0xa08): undefined reference to `wscrl'
textbox.c:(.text+0xa12): undefined reference to `scrollok'
textbox.c:(.text+0xa29): undefined reference to `wnoutrefresh'
textbox.c:(.text+0xa41): undefined reference to `wmove'
textbox.c:(.text+0xa49): undefined reference to `wrefresh'
textbox.c:(.text+0xa95): undefined reference to `delwin'
textbox.c:(.text+0xa9d): undefined reference to `delwin'
textbox.c:(.text+0xaa9): undefined reference to `stdscr'
textbox.c:(.text+0xad9): undefined reference to `wbkgdset'
textbox.c:(.text+0xae0): undefined reference to `acs_map'
textbox.c:(.text+0xae7): undefined reference to `waddch'
textbox.c:(.text+0xb30): undefined reference to `wnoutrefresh'
scripts/kconfig/lxdialog/textbox.o: In function `print_position':
textbox.c:(.text+0x11c): undefined reference to `wprintw'
scripts/kconfig/lxdialog/textbox.o: In function `print_line':
textbox.c:(.text+0x2e5): undefined reference to `wclrtoeol'
scripts/kconfig/lxdialog/textbox.o: In function `refresh_text_box':
textbox.c:(.text+0x3a0): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/yesno.o: In function `print_buttons':
yesno.c:(.text+0x94): undefined reference to `wmove'
scripts/kconfig/lxdialog/yesno.o: In function `dialog_yesno':
yesno.c:(.text+0x102): undefined reference to `stdscr'
yesno.c:(.text+0x13e): undefined reference to `COLS'
yesno.c:(.text+0x157): undefined reference to `LINES'
yesno.c:(.text+0x180): undefined reference to `newwin'
yesno.c:(.text+0x190): undefined reference to `keypad'
yesno.c:(.text+0x1d2): undefined reference to `wmove'
yesno.c:(.text+0x1de): undefined reference to `acs_map'
yesno.c:(.text+0x1e6): undefined reference to `waddch'
yesno.c:(.text+0x1fb): undefined reference to `acs_map'
yesno.c:(.text+0x207): undefined reference to `waddch'
yesno.c:(.text+0x22a): undefined reference to `acs_map'
yesno.c:(.text+0x22f): undefined reference to `waddch'
yesno.c:(.text+0x27f): undefined reference to `wgetch'
yesno.c:(.text+0x2be): undefined reference to `delwin'
yesno.c:(.text+0x2f1): undefined reference to `delwin'
yesno.c:(.text+0x34b): undefined reference to `wrefresh'
yesno.c:(.text+0x366): undefined reference to `delwin'
yesno.c:(.text+0x3af): undefined reference to `delwin'
yesno.c:(.text+0x3cb): undefined reference to `acs_map'
yesno.c:(.text+0x3d2): undefined reference to `waddch'
yesno.c:(.text+0x3f1): undefined reference to `delwin'
scripts/kconfig/lxdialog/yesno.o: In function `print_buttons':
yesno.c:(.text+0xb4): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `do_scroll':
menubox.c:(.text+0x22): undefined reference to `scrollok'
menubox.c:(.text+0x2d): undefined reference to `wscrl'
menubox.c:(.text+0x37): undefined reference to `scrollok'
scripts/kconfig/lxdialog/menubox.o: In function `print_arrows':
menubox.c:(.text+0xba): undefined reference to `wmove'
menubox.c:(.text+0xd9): undefined reference to `acs_map'
menubox.c:(.text+0xe1): undefined reference to `waddch'
menubox.c:(.text+0xf3): undefined reference to `waddnstr'
menubox.c:(.text+0x103): undefined reference to `wmove'
menubox.c:(.text+0x10b): undefined reference to `wrefresh'
menubox.c:(.text+0x136): undefined reference to `acs_map'
menubox.c:(.text+0x13e): undefined reference to `waddch'
menubox.c:(.text+0x145): undefined reference to `acs_map'
menubox.c:(.text+0x14d): undefined reference to `waddch'
menubox.c:(.text+0x154): undefined reference to `acs_map'
menubox.c:(.text+0x15c): undefined reference to `waddch'
menubox.c:(.text+0x163): undefined reference to `acs_map'
menubox.c:(.text+0x16b): undefined reference to `waddch'
menubox.c:(.text+0x17a): undefined reference to `wmove'
menubox.c:(.text+0x1c3): undefined reference to `acs_map'
menubox.c:(.text+0x1cb): undefined reference to `waddch'
menubox.c:(.text+0x1dd): undefined reference to `waddnstr'
menubox.c:(.text+0x1fb): undefined reference to `acs_map'
menubox.c:(.text+0x203): undefined reference to `waddch'
menubox.c:(.text+0x20a): undefined reference to `acs_map'
menubox.c:(.text+0x212): undefined reference to `waddch'
menubox.c:(.text+0x219): undefined reference to `acs_map'
menubox.c:(.text+0x221): undefined reference to `waddch'
menubox.c:(.text+0x228): undefined reference to `acs_map'
menubox.c:(.text+0x230): undefined reference to `waddch'
scripts/kconfig/lxdialog/menubox.o: In function `do_print_item':
menubox.c:(.text+0x2d1): undefined reference to `wmove'
menubox.c:(.text+0x2d9): undefined reference to `wclrtoeol'
menubox.c:(.text+0x2ff): undefined reference to `wmove'
menubox.c:(.text+0x314): undefined reference to `waddnstr'
menubox.c:(.text+0x34a): undefined reference to `wmove'
menubox.c:(.text+0x35f): undefined reference to `waddch'
menubox.c:(.text+0x377): undefined reference to `wmove'
menubox.c:(.text+0x3b7): undefined reference to `wmove'
menubox.c:(.text+0x3be): undefined reference to `wclrtoeol'
scripts/kconfig/lxdialog/menubox.o: In function `print_buttons':
menubox.c:(.text+0x491): undefined reference to `wmove'
scripts/kconfig/lxdialog/menubox.o: In function `dialog_menu':
menubox.c:(.text+0x502): undefined reference to `stdscr'
menubox.c:(.text+0x571): undefined reference to `COLS'
menubox.c:(.text+0x585): undefined reference to `stdscr'
menubox.c:(.text+0x592): undefined reference to `LINES'
menubox.c:(.text+0x5cb): undefined reference to `newwin'
menubox.c:(.text+0x5db): undefined reference to `keypad'
menubox.c:(.text+0x621): undefined reference to `wmove'
menubox.c:(.text+0x62d): undefined reference to `acs_map'
menubox.c:(.text+0x635): undefined reference to `waddch'
menubox.c:(.text+0x653): undefined reference to `acs_map'
menubox.c:(.text+0x65f): undefined reference to `waddch'
menubox.c:(.text+0x686): undefined reference to `wbkgdset'
menubox.c:(.text+0x68d): undefined reference to `acs_map'
menubox.c:(.text+0x695): undefined reference to `waddch'
menubox.c:(.text+0x6f4): undefined reference to `subwin'
menubox.c:(.text+0x704): undefined reference to `keypad'
menubox.c:(.text+0x868): undefined reference to `wnoutrefresh'
menubox.c:(.text+0x8ba): undefined reference to `wmove'
menubox.c:(.text+0x8c2): undefined reference to `wrefresh'
menubox.c:(.text+0x8e4): undefined reference to `wgetch'
menubox.c:(.text+0xa15): undefined reference to `wrefresh'
menubox.c:(.text+0xafc): undefined reference to `wnoutrefresh'
menubox.c:(.text+0xb04): undefined reference to `wrefresh'
menubox.c:(.text+0xb21): undefined reference to `delwin'
menubox.c:(.text+0xb29): undefined reference to `delwin'
menubox.c:(.text+0xdf4): undefined reference to `delwin'
menubox.c:(.text+0xdfc): undefined reference to `delwin'
menubox.c:(.text+0xe5c): undefined reference to `scrollok'
menubox.c:(.text+0x105c): undefined reference to `delwin'
menubox.c:(.text+0x1064): undefined reference to `delwin'
menubox.c:(.text+0x10e6): undefined reference to `delwin'
menubox.c:(.text+0x10ee): undefined reference to `delwin'
menubox.c:(.text+0x1166): undefined reference to `wbkgdset'
menubox.c:(.text+0x116d): undefined reference to `acs_map'
menubox.c:(.text+0x1174): undefined reference to `waddch'
scripts/kconfig/lxdialog/menubox.o: In function `do_scroll':
menubox.c:(.text+0x55): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `print_arrows':
menubox.c:(.text+0x1a4): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `do_print_item':
menubox.c:(.text+0x3a9): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `print_buttons':
menubox.c:(.text+0x4b1): undefined reference to `wrefresh'
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2

2013年1月30日 星期三

[C/C++][GCC] 確認某個檔案是否真的有被included 的方法

通常一個大型project, 很多header files會被incldued, 但是往往有時候目錄與檔案結構你可能不熟析, 或者一堆人同時在修改開發, 這時候你可能會想要撿查某個header file是否真的有被included, 有個方法可以很簡單的做到檢查
就是透過 在檔案裡面加入 #warning "MESSAGE"的方式 讓compiler在編譯的時候顯示出該行MESSAGE


查看GCC幫你加了什麼東西來編譯檔案

舉例來說 如果你原本的編譯指令為

/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/msdk-linux-gcc -I.. -I../.. -I../../include -O -DOPENSSL_THREADS -pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE  -fPIC   -c -o bss_dgram.o bss_dgram.c

如果編譯過程遇到一些問題而想查看到底gcc幫你加了什麼來編譯該檔案
可以在同樣的指令後面再加上
 -E -v
如:
/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/msdk-linux-gcc -I.. -I../.. -I../../include -O -DOPENSSL_THREADS -pthread -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE  -fPIC   -c -o bss_dgram.o bss_dgram.c -E -v

如此就不會真的去編譯檔案 而是列出gcc 的一些設定與參考路徑, 以上面例子在我自己的pc上為例, 會看到


Using built-in specs.
Target: mips-linux
Configured with: MSDK Builder release 4.3
Thread model: posix
gcc version 4.3.6 20110218 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-nostdinc' '-isystem' '/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include' '-idirafter' '/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include/gcc' '-mhard-float' '-EL' '-mips32r2' '-I..' '-I../..' '-I../../include' '-O' '-DOPENSSL_THREADS' '-pthread' '-D_REENTRANT' '-D_THREAD_SAFE' '-D_THREADSAFE' '-fPIC' '-c' '-o' 'bss_dgram.o' '-E' '-v' '-mllsc'
 /usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../libexec/gcc/mips-linux/4.3.6/cc1 -E -quiet -nostdinc -v -I.. -I../.. -I../../include -imultilib el -iprefix /usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../lib/gcc/mips-linux/4.3.6/ -D_REENTRANT -DOPENSSL_THREADS -D_REENTRANT -D_THREAD_SAFE -D_THREADSAFE -isystem /usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include -idirafter /usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include/gcc bss_dgram.c -o bss_dgram.o -mel -mhard-float -mips32r2 -mllsc -fPIC -O
#include "..." search starts here:
#include <...> search starts here:
 ..
 ../..
 ../../include
 /usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include
 /usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include/gcc
End of search list.
COMPILER_PATH=/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../libexec/gcc/mips-linux/4.3.6/:/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../libexec/gcc/:/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../lib/gcc/mips-linux/4.3.6/../../../../mips-linux/bin/
LIBRARY_PATH=/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../lib/gcc/mips-linux/4.3.6/el/:/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../lib/gcc/mips-linux/4.3.6/:/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../lib/gcc/:/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/bin/../lib/gcc/mips-linux/4.3.6/../../../../mips-linux/lib/
COLLECT_GCC_OPTIONS='-nostdinc' '-isystem' '/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include' '-idirafter' '/usr/local/msdk-4.3.6-mips-EL-2.6.34-0.9.30.3_hwfpu/include/gcc' '-mhard-float' '-EL' '-mips32r2' '-I..' '-I../..' '-I../../include' '-O' '-DOPENSSL_THREADS' '-pthread' '-D_REENTRANT' '-D_THREAD_SAFE' '-D_THREADSAFE' '-fPIC' '-c' '-o' 'bss_dgram.o' '-E' '-v' '-mllsc'




2013年1月28日 星期一

remove all .svn folders

當拿到一整包source code 但不想要有保留裡面的.svn folders的話
可以用以下command 把folder裡面(包含所有sub-folders)的.svn folder通通delete
find /path/to/target/folder -type d -name '.svn' -exec rm -rf {} \;