Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't compiled memcached-2.1.0 on CentOS 6.4 with libmemcached 1.0.17. #69

Closed
YutaroOsawa opened this issue Apr 5, 2013 · 13 comments
Closed

Comments

@YutaroOsawa
Copy link

I tried to compile memcached-2.1.0 on CentOS 6.4. I executed following commands on console for compile it.

pecl install memcached

but compilation was faiured, because of following erros.

/var/tmp/memcached/php_memcached.c:318: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/var/tmp/memcached/php_memcached.c:319: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/var/tmp/memcached/php_memcached.c:320: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/var/tmp/memcached/php_memcached.c: In function ‘php_memc_get_impl’:
/var/tmp/memcached/php_memcached.c:599: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c: In function ‘php_memc_getMulti_impl’:
/var/tmp/memcached/php_memcached.c:797: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c:800: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c: In function ‘zim_Memcached_fetch’:
/var/tmp/memcached/php_memcached.c:1014: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c:1017: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c: In function ‘zim_Memcached_fetchAll’:
/var/tmp/memcached/php_memcached.c:1068: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c:1071: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c: In function ‘zim_Memcached_getServerList’:
/var/tmp/memcached/php_memcached.c:1948: warning: assignment from incompatible pointer type
/var/tmp/memcached/php_memcached.c: In function ‘zim_Memcached_getServerByKey’:
/var/tmp/memcached/php_memcached.c:1977: warning: assignment from incompatible pointer type
/var/tmp/memcached/php_memcached.c: In function ‘zim_Memcached_getStats’:
/var/tmp/memcached/php_memcached.c:2056: warning: assignment from incompatible pointer type
/var/tmp/memcached/php_memcached.c: In function ‘zim_Memcached_getVersion’:
/var/tmp/memcached/php_memcached.c:2089: warning: assignment from incompatible pointer type
/var/tmp/memcached/php_memcached.c: At top level:
/var/tmp/memcached/php_memcached.c:2576: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/var/tmp/memcached/php_memcached.c: In function ‘php_memc_do_serverlist_callback’:
/var/tmp/memcached/php_memcached.c:2583: error: ‘instance’ undeclared (first use in this function)
/var/tmp/memcached/php_memcached.c:2583: error: (Each undeclared identifier is reported only once
/var/tmp/memcached/php_memcached.c:2583: error: for each function it appears in.)
/var/tmp/memcached/php_memcached.c: At top level:
/var/tmp/memcached/php_memcached.c:2593: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/var/tmp/memcached/php_memcached.c: In function ‘php_memc_do_stats_callback’:
/var/tmp/memcached/php_memcached.c:2599: error: ‘instance’ undeclared (first use in this function)
/var/tmp/memcached/php_memcached.c: At top level:
/var/tmp/memcached/php_memcached.c:2637: error: expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/var/tmp/memcached/php_memcached.c: In function ‘php_memc_do_version_callback’:
/var/tmp/memcached/php_memcached.c:2644: error: ‘instance’ undeclared (first use in this function)
/var/tmp/memcached/php_memcached.c: In function ‘php_memc_do_result_callback’:
/var/tmp/memcached/php_memcached.c:3191: warning: assignment discards qualifiers from pointer target type
/var/tmp/memcached/php_memcached.c:3194: warning: assignment discards qualifiers from pointer target type
make: *** [php_memcached.lo] Error 1
ERROR: `make' failed

@ghost
Copy link

ghost commented Apr 19, 2013

I get the same error on Debian 6:

root@x:/php-memcached# make
/bin/bash /php-memcached/libtool --mode=compile cc -I/usr/include/php5 -I. -I/php-memcached -DPHP_ATOM_INC -I/php-memcached/include -I/php-memcached/main -I/php-memcached -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /php-memcached/php_memcached.c -o php_memcached.lo
libtool: compile: cc -I/usr/include/php5 -I. -I/php-memcached -DPHP_ATOM_INC -I/php-memcached/include -I/php-memcached/main -I/php-memcached -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /php-memcached/php_memcached.c -fPIC -DPIC -o .libs/php_memcached.o
/php-memcached/php_memcached.c:324: error: expected declaration specifiers or '...' before 'memcached_server_instance_st'
/php-memcached/php_memcached.c:325: error: expected declaration specifiers or '...' before 'memcached_server_instance_st'
/php-memcached/php_memcached.c:326: error: expected declaration specifiers or '...' before 'memcached_server_instance_st'
/php-memcached/php_memcached.c: In function 'php_memc_get_impl':
/php-memcached/php_memcached.c:605: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c: In function 'php_memc_getMulti_impl':
/php-memcached/php_memcached.c:803: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c:806: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c: In function 'zim_Memcached_fetch':
/php-memcached/php_memcached.c:1020: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c:1023: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c: In function 'zim_Memcached_fetchAll':
/php-memcached/php_memcached.c:1074: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c:1077: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c: In function 'zim_Memcached_getServerList':
/php-memcached/php_memcached.c:1955: warning: assignment from incompatible pointer type
/php-memcached/php_memcached.c: In function 'zim_Memcached_getServerByKey':
/php-memcached/php_memcached.c:1968: error: 'memcached_server_instance_st' undeclared (first use in this function)
/php-memcached/php_memcached.c:1968: error: (Each undeclared identifier is reported only once
/php-memcached/php_memcached.c:1968: error: for each function it appears in.)
/php-memcached/php_memcached.c:1968: error: 'server_instance' undeclared (first use in this function)
/php-memcached/php_memcached.c: In function 'zim_Memcached_getLastDisconnectedServer':
/php-memcached/php_memcached.c:2086: error: 'memcached_server_instance_st' undeclared (first use in this function)
/php-memcached/php_memcached.c:2086: error: 'server_instance' undeclared (first use in this function)
/php-memcached/php_memcached.c: In function 'zim_Memcached_getStats':
/php-memcached/php_memcached.c:2138: warning: assignment from incompatible pointer type
/php-memcached/php_memcached.c: In function 'zim_Memcached_getVersion':
/php-memcached/php_memcached.c:2171: warning: assignment from incompatible pointer type
/php-memcached/php_memcached.c: At top level:
/php-memcached/php_memcached.c:2663: error: expected declaration specifiers or '...' before 'memcached_server_instance_st'
/php-memcached/php_memcached.c: In function 'php_memc_do_serverlist_callback':
/php-memcached/php_memcached.c:2670: error: 'instance' undeclared (first use in this function)
/php-memcached/php_memcached.c: At top level:
/php-memcached/php_memcached.c:2681: error: expected declaration specifiers or '...' before 'memcached_server_instance_st'
/php-memcached/php_memcached.c: In function 'php_memc_do_stats_callback':
/php-memcached/php_memcached.c:2687: error: 'instance' undeclared (first use in this function)
/php-memcached/php_memcached.c: At top level:
/php-memcached/php_memcached.c:2725: error: expected declaration specifiers or '...' before 'memcached_server_instance_st'
/php-memcached/php_memcached.c: In function 'php_memc_do_version_callback':
/php-memcached/php_memcached.c:2732: error: 'instance' undeclared (first use in this function)
/php-memcached/php_memcached.c: In function 'php_memc_do_result_callback':
/php-memcached/php_memcached.c:3291: warning: assignment discards qualifiers from pointer target type
/php-memcached/php_memcached.c:3294: warning: assignment discards qualifiers from pointer target type
make: *** [php_memcached.lo] Error 1

@vbtechsupport
Copy link

Exact same problem here as well with CentOS 6.4 64bit and libmemcached 1.0.17 was fine with 1.0.16

@thejusme
Copy link

Yep, in version 2.0.1 php_libmemcached_compat.h had:

typedef const struct memcached_server_st *memcached_server_instance_st;

But then it was removed in 2.1.0. As it currently stands, you could consider PECL memcached 2.1.0 incompatible with libmemcached 1.0.17 (and probably future versions as well). Of course you could put the line above back into php_libmemcached_compat.h for version 2.1.0 and it will compile and work just fine. A new release of PECL memcached should be forthcoming at some point to be compatible with libmemcached >= 1.0.17.

@Zewy
Copy link

Zewy commented May 31, 2013

I got the same problem is this going to get fixed?

@jdoss
Copy link

jdoss commented May 31, 2013

Seems to be the same issue.

https://gist.github.com/jdoss/5688399

Would be nice to not have to install memcached and libmemcached from alt sources to get this installed via PECL.

# cat /etc/redhat-release 
CentOS release 6.4 (Final)
# rpm -qa |grep memcac
libmemcached-0.31-1.1.el6.x86_64
libmemcached-devel-0.31-1.1.el6.x86_64
memcached-devel-1.4.4-3.el6.x86_64
memcached-1.4.4-3.el6.x86_64

@ljcqx
Copy link

ljcqx commented Jul 11, 2013

[root@localhost memcached-2.1.0]# make
/bin/sh /root/memcached-2.1.0/libtool --mode=compile cc -I/usr/local/include/php -I. -I/root/memcached-2.1.0 -DPHP_ATOM_INC -I/root/memcached-2.1.0/include -I/root/memcached-2.1.0/main -I/root/memcached-2.1.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /root/memcached-2.1.0/php_memcached.c -o php_memcached.lo
mkdir .libs
cc -I/usr/local/include/php -I. -I/root/memcached-2.1.0 -DPHP_ATOM_INC -I/root/memcached-2.1.0/include -I/root/memcached-2.1.0/main -I/root/memcached-2.1.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /root/memcached-2.1.0/php_memcached.c -fPIC -DPIC -o .libs/php_memcached.o
/root/memcached-2.1.0/php_memcached.c:318: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c:319: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c:320: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_get_impl’中:
/root/memcached-2.1.0/php_memcached.c:599: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_getMulti_impl’中:
/root/memcached-2.1.0/php_memcached.c:797: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:800: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_fetch’中:
/root/memcached-2.1.0/php_memcached.c:1014: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:1017: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_fetchAll’中:
/root/memcached-2.1.0/php_memcached.c:1068: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:1071: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getServerList’中:
/root/memcached-2.1.0/php_memcached.c:1948: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getServerByKey’中:
/root/memcached-2.1.0/php_memcached.c:1977: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getStats’中:
/root/memcached-2.1.0/php_memcached.c:2056: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在函数‘zim_Memcached_getVersion’中:
/root/memcached-2.1.0/php_memcached.c:2089: 警告:从不兼容的指针类型赋值
/root/memcached-2.1.0/php_memcached.c: 在文件层:
/root/memcached-2.1.0/php_memcached.c:2576: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_serverlist_callback’中:
/root/memcached-2.1.0/php_memcached.c:2583: 错误:‘instance’未声明(在此函数内第一次使用)
/root/memcached-2.1.0/php_memcached.c:2583: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
/root/memcached-2.1.0/php_memcached.c:2583: 错误:所在的函数内也只报告一次。)
/root/memcached-2.1.0/php_memcached.c: 在文件层:
/root/memcached-2.1.0/php_memcached.c:2593: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_stats_callback’中:
/root/memcached-2.1.0/php_memcached.c:2599: 错误:‘instance’未声明(在此函数内第一次使用)
/root/memcached-2.1.0/php_memcached.c: 在文件层:
/root/memcached-2.1.0/php_memcached.c:2637: 错误:expected declaration specifiers or ‘...’ before ‘memcached_server_instance_st’
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_version_callback’中:
/root/memcached-2.1.0/php_memcached.c:2644: 错误:‘instance’未声明(在此函数内第一次使用)
/root/memcached-2.1.0/php_memcached.c: 在函数‘php_memc_do_result_callback’中:
/root/memcached-2.1.0/php_memcached.c:3191: 警告:赋值丢弃了指针目标类型的限定
/root/memcached-2.1.0/php_memcached.c:3194: 警告:赋值丢弃了指针目标类型的限定
make: *** [php_memcached.lo] 错误 1

@golangfan
Copy link

use libmemcached 1.0.16 is OK

@Sydney-o9
Copy link

use libmemcached 1.0.16 as well and worked out OK

mkoppanen added a commit to mkoppanen/php-memcached that referenced this issue Oct 7, 2013
@mkoppanen
Copy link
Member

Are you able to build using the PR mentioned above? Works for me on Mac OS X.

mkoppanen pushed a commit that referenced this issue Oct 7, 2013
A bit of general maintenance, mainly related to issue #69
mkoppanen added a commit to mkoppanen/php-memcached that referenced this issue Oct 17, 2013
mkoppanen added a commit to mkoppanen/php-memcached that referenced this issue Oct 17, 2013
@th3fallen
Copy link

@mkoppanen im still getting a failure when attempting to compile identical to the other, what was the solution for this issue?

cat /etc/redhat-release

CentOS release 6.4 (Final)

rpm -qa |grep memcac

libmemcached-1.0.16-1.el6.remi.x86_64
memcached-devel-1.4.15-1.x86_64
memcached-1.4.15-1.x86_64
libmemcached-devel-1.0.16-1.el6.remi.x86_64

@mkoppanen
Copy link
Member

Are you testing with current master or 2.1.0 release?

@th3fallen
Copy link

i was attempting with 2.1.0 release from pecl but i just built it successfully from the current master.

@mkoppanen
Copy link
Member

yep, that's the solution. I will do a release later once we finish the feature set for 2.2.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants