Reputation: 1931
Here's what I did... #tar -xzvf libnet-0.10.11.tar.gz #cd libnet
Then I copied the linux.mak file to the port.mak file in the parent directory. Then, as the documentation says, I used make in the present directory...
naman@naman-laptop:~/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
Can anyone please explain the error to me in detail, and how to rectify it? Any help would be much appreciated.
Upvotes: 1
Views: 1437
Reputation: 408
https://github.com/sam-github/libnet, that is an ancient libnet version, modern one uses autoconf, do you need to use such an old one?
I'd suggest removing both -Wall
and -Werror
from the makefile you are using.
Upvotes: 1
Reputation: 13947
It looks like you are trying to compile an older library on a newer system, and new warnings have been added to gcc
since this library was written.
Since the Makefile has warnings treated as errors, (you can tell because it printed cc1: warnings being treated as errors
) the warning warn_unused_result
errors are causing the compile to fail.
Your options are to either:
-Werror
parameter(s)Upvotes: 0