Error: "IOV_MAX is not declared (first used in this function)

I am trying to install memcached-1.2.8-repcached-2.2.1

I have the following error after running make :

 $ make all-recursive make[1]: Entering directory `/usr/local/src/pro/memcached-1.2.8-repcached-2.2.1' Making all in doc make[2]: Entering directory `/usr/local/src/pro/memcached-1.2.8-repcached-2.2.1/doc' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/usr/local/src/pro/memcached-1.2.8-repcached-2.2.1/doc' make[2]: Entering directory `/usr/local/src/pro/memcached-1.2.8-repcached-2.2.1' gcc -DHAVE_CONFIG_H -I. -DNDEBUG -g -O2 -MT memcached-memcached.o -MD -MP -MF .d eps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.c memcached.c: In function 'add_iov': memcached.c:697: error: 'IOV_MAX' undeclared (first use in this function) memcached.c:697: error: (Each undeclared identifier is reported only once memcached.c:697: error: for each function it appears in.) make[2]: *** [memcached-memcached.o] Error 1 make[2]: Leaving directory `/usr/local/src/pro/memcached-1.2.8-repcached-2.2.1' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/pro/memcached-1.2.8-repcached-2.2.1' make: *** [all] Error 2 

OS: Centos5.7 64bit

GCC-4.1.2-51.el5

GCC-C ++ - 4.1.2-51.el5

libgcc-4.1.2-51.el5

Is there something wrong with IOV_MAX in gcc, file headers ... etc?

+4
source share
3 answers

you must

yum remove libevent2-devel

yum install libevent libevent-devel

+1
source

This indicates flaws in the included files, or possibly in the inclusion path or environment.

It is not clear how this should have been determined:

memcached.c line 33 should specify __need_IOV_MAX
memcached.c line 42 includes stdio.h
stdio.h (on my system anyway) line 161 includes bits/stdio_lim.h
The last lines of stdio_lim.h (lines 42-43) should define it:

 #if defined __need_IOV_MAX && !defined IOV_MAX # define IOV_MAX 1024 #endif 

I tried to create memcached, but there is something messed up as it depends on libevent. These are the last few lines from configure in Fedora 15:

 ... checking for a BSD-compatible install... /usr/bin/install -c checking for libevent directory... configure: error: libevent is required. You can get it from http://www.monkey.org/~provos/libevent/ If it already installed, specify its path using --with-libevent=/dir/ [ wally@lenovotower memcached-1.2.8-repcached-2.2.1]$ rpm -q libevent libevent-2.0.10-2.fc15.i686 [ wally@lenovotower memcached-1.2.8-repcached-2.2.1]$ 

But in /usr/... there is no event.h .

+1
source

If you have the same compilation situation on Ubuntu 12.10 (and possibly in other versions), you need to install the libevent1-dev package.

+1
source

Source: https://habr.com/ru/post/1393273/


All Articles