当我通过sudo apt-get install libnet1安装libnet时,程序找不到libnet.h,我也无法在/ usr / local / include或/ usr / include中找到它。 所以我下载了libnet并制作它,但我得到了错误
make -C lib/ lib
make[1]: Entering director `/home/liuqiang/workspace/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/liuqiang/workspace/libnet/lib'
make: *** [lib] error 2
答案 0 :(得分:14)
总是一样的:您需要libfoo-dev
包来构建来对抗库 foo 中的源代码,因为libfoo
包只能确保您可以运行代码。
所以这里libnet1
:运行apt-get install libnet1-dev
,你应该很好地继续前进。