2011-01-27 75 views
1

這裏就是我沒有... #tar -xzvf的libnet-0.10.11.tar.gz #CD的libnet麻煩上安裝的libnet-0.10.11 Ubuntu的9.10

然後我複製了linux.mak文件添加到父目錄中的port.mak文件中。 那麼,作爲文檔中說,我曾經使本目錄...

[email protected]:~/Desktop/Software/libnet$ make 
make -C lib/ lib 
make[1]: Entering directory `/home/naman/Desktop/Software/libnet/lib' 
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g -I../include -Iinclude -DTARGET_LINUX -c -o core/config.o core/config.c 
cc1: warnings being treated as errors 
core/config.c: In function ‘__libnet_internal__seek_section’: 
core/config.c:87: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result 
core/config.c: In function ‘__libnet_internal__get_setting’: 
core/config.c:111: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result 
make[1]: *** [core/config.o] Error 1 
make[1]: Leaving directory `/home/naman/Desktop/Software/libnet/lib' 
make: *** [lib] Error 2 

任何人都可以請解釋的錯誤給我的細節,以及如何糾正呢?任何幫助將非常感激。

回答

0

看起來您正試圖在較新的系統上編譯較舊的庫,並且自編寫此庫以來已將新警告添加到gcc

由於Makefile的警告被視爲錯誤,(因爲它打印cc1: warnings being treated as errors,所以可以告訴)警告warn_unused_result錯誤導致編譯失敗。

的選項包括要麼:

  1. 編輯生成文件(一個或多個),並移除任何-Werror參數(一個或多個)
  2. 修復的根本原因(未使用與fgets()的返回值的代碼)
  3. 找到一個不同的庫來使用 - 爲什麼你想在你的系統上使用這個(可能未被維護的)庫?
1

https://github.com/sam-github/libnet,這是一個古老的libnet版本,現代的使用autoconf,你需要使用這樣一箇舊的?

我建議從您正在使用的makefile中刪除-Wall-Werror