So, I'm trying to compile my C code using the command "gcc -o file file.c", but I get "error: libnet.h: No such file or directory" I included libnet.h (#include ) and I also installed libnet. I'm running CentOS 7.
Asked
Active
Viewed 3,560 times
1
-
Where/how did you install libnet? – Chris Turner Nov 29 '18 at 17:51
-
1You may have to specify `-I /path/to/libnet.h` – Robert Nov 29 '18 at 17:52
-
@ChrisTurner I installed it using the command "yum install libnet" – Davidoff7776 Nov 29 '18 at 17:52
-
@Robert I don't know where is located. – Davidoff7776 Nov 29 '18 at 17:55
-
Hi @Richardmikelson! Could you show us a minimum example of the code that you are trying to compile? – Rocío García Luque Nov 29 '18 at 19:01
-
1@Rocío I fixed it. – Davidoff7776 Nov 29 '18 at 19:04
1 Answers
2
yum install libnet
only installs the precompiled library.
You need to install the headers using yum install libnet-devel
before you can use it in your own software.

contrapants
- 775
- 4
- 16