I am trying to install SOCAT and I am quite lite on C++. So following the instructions HERE I am able to get the latest stable version of 1.7.3.1 downloaded, I get through the ./configure
, but when I go into ./make
I get the following error:
nestlex.c:14:7: error: unknown type name ‘ptrdiff_t’
ptrdiff_t *len,
^
nestlex.c: In function ‘nestlex’:
nestlex.c:48:7: warning: implicit declaration of function ‘_nestlex’ [-Wimplicit-function-declaration]
_nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests,
^
nestlex.c:48:30: error: ‘ptrdiff_t’ undeclared (first use in this function)
_nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests,
^
nestlex.c:48:30: note: each undeclared identifier is reported only once for each function it appears in
nestlex.c:48:41: error: expected expression before ‘)’ token
_nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests,
^
nestlex.c: At top level:
nestlex.c:54:7: error: unknown type name ‘ptrdiff_t’
ptrdiff_t *len,
^
nestlex.c: In function ‘nestlex’:
nestlex.c:50:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: *** [nestlex.o] Error 1
System Information:
cat system-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
rpm -qa |grep gcc
libgcc-4.8.5-4.el7.x86_64
gcc-4.8.5-4.el7.x86_64
rpm -qa |grep glibc
glibc-common-2.17-106.el7_2.6.x86_64
glibc-2.17-106.el7_2.6.x86_64
glibc-devel-2.17-106.el7_2.6.x86_64
glibc-headers-2.17-106.el7_2.6.x86_64
rpm -qa |grep gd
gdisk-0.8.6-5.el7.x86_64
gd-2.0.35-26.el7.x86_64
gdbm-1.10-8.el7.x86_64
I am not sure where to go from here, as I am fairly new to having to install from source. I have found a few articles describing the problem as not having the correct version of the headers installed. If someone could point me in the right direction, I would greatly appreciate it.
Thanks in advance.
The unknown type is defined in the header file stddef.h
. If there's no #include <stddef.h>
in the file for whose compilation the error is reported, add it somewhere at the top. Since header inclusion is transitive in nature, these kinds of errors sometimes happens when the necessary include was present in another header that still is included, but a newer version dropped that include for some reason.
One can usually find where common types are defined by searching here for example.