其實不只有在Mountain Lion有遇到這個問題
在還沒升級前的Snow Leopard也遇過一樣的問題
在安裝完readline和ncurse後(安裝readline若遇到-dynamiclib請見之前的文章)
就是到cgdb解開壓縮檔 然後執行
1) ./configure --prefix=/usr/local
2) make
接著馬上就會遇到一連串undefined symbol的問題
這些symbol通常都是一堆由 "_rl_" 開頭的function
(在snow leopard和mountain lion遇到的不太一樣 不過大致都是以 "_rl_" 開頭)
gcc -I../../../lib/adt -I../../../lib/rline -I../../../lib/util -I../../../lib/tgdb/annotate-two -I../../../lib/tgdb/gdbmi -I../../../lib/tgdb/tgdb-base -g -O2 -L../../../lib/adt -L../../../lib/rline -L../../../lib/util -L../../../lib/tgdb/annotate-two -L../../../lib/tgdb/gdbmi -L../../../lib/tgdb/tgdb-base -o tgdb_driver driver.o libtgdb.a ../../../lib/tgdb/annotate-two/libtgdb_a2.a ../../../lib/tgdb/gdbmi/libtgdb_mi.a ../../../lib/rline/librline.a ../../../lib/adt/libadt.a ../../../lib/util/libutil.a -lreadline -lncurses -lm
Undefined symbols for architecture x86_64:
"_rl_catch_sigwinch", referenced from:
_rline_initialize in librline.a(rline.o)
"_rl_complete_internal", referenced from:
_rline_rl_complete in librline.a(rline.o)
"_rl_completion_mode", referenced from:
_rline_rl_complete in librline.a(rline.o)
"_rl_completion_word_break_hook", referenced from:
_rline_rl_complete in librline.a(rline.o)
"_rl_delete_text", referenced from:
_rline_clear in librline.a(rline.o)
"_rl_invoking_keyseqs", referenced from:
_rline_get_keyseq in librline.a(rline.o)
"_rl_last_func", referenced from:
_rline_rl_complete in librline.a(rline.o)
_rline_rl_callback_read_char in librline.a(rline.o)
"_rl_mark", referenced from:
_rline_clear in librline.a(rline.o)
"_rl_named_function", referenced from:
_rline_get_keyseq in librline.a(rline.o)
"_rl_resize_terminal", referenced from:
_rline_resize_terminal_and_redisplay in librline.a(rline.o)
"_rl_translate_keyseq", referenced from:
_rline_get_keyseq in librline.a(rline.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [tgdb_driver] Error 1
解法如下:
把/usr/lib/libreadline.dylib砍掉就好 ==...
(可以試著把libreadline.dylib改名成libreadline_backup.dylib
然後重新到readline-6.1的資料夾下執行sudo make install一遍
會發現/usr/lib/下並不會產生新的libreadline.dylib
也就是說其實那個檔跟本就不是readline-6.1產生的
哪來的別問我 可能是系統本來就有 或是其他程式安裝時偷偷灌的 但沒灌完整就是了)
砍掉libreadline.dylib後重新make就搞定了
別忘了最後一步 sudo make install
2013年1月31日 星期四
2012年11月17日 星期六
[Not Original] Apache with virtual hosts, PHP and SSI on Mac OS X 10.6
[From http://www.456bereastreet.com/archive/201104/apache_with_virtual_hosts_php_and_ssi_on_mac_os_x_106/ ]
I found this website when I was working on enabling SSI on Mac OS and found it extremely quick and useful.
I paste the whole paragraph here in case I might need it when the site is down. Thanks for the author and this awesome article.
I found this website when I was working on enabling SSI on Mac OS and found it extremely quick and useful.
I paste the whole paragraph here in case I might need it when the site is down. Thanks for the author and this awesome article.
2012年5月1日 星期二
[重構] Premature Optimization is The Root of All Evil
最近讀了一些重構(refactoring)和專案建置的書
感覺C++的功力又更上一層
不過我這邊要講的跟是不是用C++沒有太大的關係
只要你是用物件導向(object oriented)的程式語言來撰寫程式就夠了
你可以直接在Google輸入
"Premature Optimization is The Root of All Evil"
就會找到一堆相關的文章
Google甚至會在你打入premature optimization後就會提示你 is the root of all evil
翻成中文後大致上的意思是
"過早的最佳化是所有罪惡的根源"
大概有90%的最佳化的動作
都會在完整的專案完成後發現一點屁用都沒有
感覺C++的功力又更上一層
不過我這邊要講的跟是不是用C++沒有太大的關係
只要你是用物件導向(object oriented)的程式語言來撰寫程式就夠了
你可以直接在Google輸入
"Premature Optimization is The Root of All Evil"
就會找到一堆相關的文章
Google甚至會在你打入premature optimization後就會提示你 is the root of all evil
翻成中文後大致上的意思是
"過早的最佳化是所有罪惡的根源"
大概有90%的最佳化的動作
都會在完整的專案完成後發現一點屁用都沒有
2012年4月23日 星期一
[C++] const 篇
在之前的文章中有提到
我們如果要為類別(class)撰寫介面函式如get的話
可以寫成:
vector& getNameList() {
return _nameList;
}
const vector& getNameList() const {
return _nameList;
}
不過其實const的學問是很博大精深的
2012年4月19日 星期四
[Ubuntu]
每次重灌ubuntu時都會發現缺東缺西的
趕緊記下來以免又忘了
[Git]
sudo apt-get install git-core git-doc gitweb git-gut gitk git-email git-svn趕緊記下來以免又忘了
[Git]
git config --global color.ui true
git config --global user.name "Boton Chou"
git config --global user.email "xxx@gmail.com"
git config --global user.name "Boton Chou"
git config --global user.email "xxx@gmail.com"
訂閱:
文章 (Atom)