Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install libraries for <stropts.h>?

Tags:

c++

c

gcc

debian

I am running Kali-Linux (debian+gnome). When I compile I get compilation error:

cc -Wall -g   -c -o frag.o frag.c
frag.c:7:10: fatal error: stropts.h: No such file or directory
    7 | #include <stropts.h>
      |          ^~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: frag.o] Error 1

Can anyone tell me what am I missing and what should I install? I tried installing glibc-sources but still it didn't work out.

like image 909
Machinexa Avatar asked Apr 04 '20 14:04

Machinexa


Video Answer


1 Answers

As mentioned by the other answer, this library is not used on Linux. Since this came up when trying to compile an application on Linux, it's possible an #if was not set correctly.

As a workaround, look at the source code to see what the #if surrounding the #include is, and set that to false when compiling.

For example, if the code looked like:

#if HAVE_STROPTS_H
#include <stropts.h>
#endif

And if you are using cmake or gcc, run them with -DHAVE_STROPTS_H=0.

like image 99
jddp Avatar answered Sep 29 '22 20:09

jddp