1、到網(wǎng)上下載 larbin-2.6.3.tar.gz,然后解壓。
tar zxvf larbin- 2.6 . 3 .tar.gz
2、 到解壓的目錄,運(yùn)行配置文件
./configure
卻出現(xiàn)以下的錯(cuò)誤:
make[2]: 正在進(jìn)入目錄 `/home/byd/test/larbin-2.6.3/src/utils'
makedepend -f- -I.. -Y *.cc 2> /dev/null > .depend
make[2]: *** [dep-in] 錯(cuò)誤 127
make[2]:正在離開目錄 `/home/byd/test/larbin-2.6.3/src/utils'
make[2]: 正在進(jìn)入目錄 `/home/byd/test/larbin-2.6.3/src/interf'
makedepend
-f- -I.. -Y *.cc 2> /dev/null > .depend
make[2]: *** [dep-in] 錯(cuò)誤 127
make[2]:正在離開目錄 `/home/byd/test/larbin-2.6.3/src/interf'
make[2]: 正在進(jìn)入目錄 `/home/byd/test/larbin-2.6.3/src/fetch'
makedepend -f- -I.. -Y *.cc 2> /dev/null > .depend
make[2]: *** [dep-in] 錯(cuò)誤 127
make[2]:正在離開目錄 `/home/byd/test/larbin-2.6.3/src/fetch'
make[1]: *** [dep] 錯(cuò)誤 2
make[1]:正在離開目錄 `/home/byd/test/larbin-2.6.3/src'
make: *** [dep] 錯(cuò)誤 2
在上面發(fā)現(xiàn)有makedepend,于是輸入
makedepend
發(fā)現(xiàn)沒有安裝,有如下的提示
The program 'makedepend' is currently not installed. You can install it by typing: sudo apt-get install xutils-dev
于是就輸入命令老老實(shí)實(shí)的安裝xutils-dev了
sudo apt-get install xutils-dev
安裝之后, ./configure 成功
3、編譯
在目錄下輸入 make 進(jìn)行編譯。又出現(xiàn)了一下的錯(cuò)誤
parse.c:113: error: conflicting types for ‘a(chǎn)dns__parse_domain’ internal.h:569: note: previous declaration of ‘a(chǎn)dns__parse_domain’ was here parse.c: In function ‘a(chǎn)dns__parse_domain_more’:
于是直接到adns目錄找到internal.h文件注釋掉568-572行。
//adns_status adns__parse_domain(adns_state ads, int serv, adns_query qu, //vbuf *vb, parsedomain_flags flags, //const byte *dgram, int dglen, int *cbyte_io, int max);
繼續(xù) make ?,又出現(xiàn)一下的錯(cuò)誤
sequencer.cc:5: fatal error: iostream.h: 沒有那個(gè)文件或目錄
代碼采用的是以前C的編碼方式,現(xiàn)在要改成 iostream ?了。于是將目錄下的所有 iostream.h 改成 iostream 。可以采用一下的命令
sed -i -e 's/iostream.h/iostream/g' `grep -rl iostream.h *`
注意:后面的包含 grep ?的不是單引號(hào),而是鍵盤左上角的符號(hào)。
繼續(xù)編譯,又出現(xiàn)錯(cuò)誤
hashTable.cc:32: error: ‘cerr’ was not declared in this scope hashTable.cc:41: error: ‘cerr’ was not declared in this scope hashTable.cc:42: error: ‘endl’ was not declared in this scope
于是將目錄下的所有cerr和 endl改成 std::cerr和std::endl。可以采用類似上面的命令。不過(guò)要注意是不是有的endl或cerr已經(jīng)是std::endl和std::cerr。
sed -i -e 's/cerr/std::cerr/g' `grep -rl cerr *`
sed -i -e 's/endl/std::endl/g' `grep -rl endl *`
至此編譯就沒有問題了。
可以發(fā)現(xiàn)在目錄下已經(jīng)生成larbin的可執(zhí)行文件。
輸入 ./larbin 就可以運(yùn)行l(wèi)arbin了。
?
?
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
