nauxliu / opencc4php

简繁体转换 PHP 扩展
MIT License
457 stars 86 forks source link

编译错误 make: *** [opencc.lo] Error 1 #35

Closed leaf-fly closed 6 years ago

leaf-fly commented 6 years ago

请问make编译的时候,出现这个提示是什么原因呢? /bin/sh /root/opencc4php/libtool --mode=compile cc -I. -I/root/opencc4php -DPHP_ATOM_INC -I/root/opencc4php/include -I/root/opencc4php/main -I/root/opencc4php -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/opencc -DHAVE_CONFIG_H -g -O2 -c /root/opencc4php/opencc.c -o opencc.lo cc -I. -I/root/opencc4php -DPHP_ATOM_INC -I/root/opencc4php/include -I/root/opencc4php/main -I/root/opencc4php -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/opencc -DHAVE_CONFIG_H -g -O2 -c /root/opencc4php/opencc.c -fPIC -DPIC -o .libs/opencc.o In file included from /root/opencc4php/php_opencc.h:24, from /root/opencc4php/opencc.c:28: /usr/include/opencc/opencc.h:66: error: expected '=', ',', ';', 'asm' or 'attribute' before 'opencc_t' /usr/include/opencc/opencc.h:75: error: expected '=', ',', ';', 'asm' or 'attribute' before 'int' /usr/include/opencc/opencc.h:91: error: expected '=', ',', ';', 'asm' or 'attribute' before 'size_t' /usr/include/opencc/opencc.h:111: error: expected '=', ',', ';', 'asm' or 'attribute' before 'char' /usr/include/opencc/opencc.h:122: error: expected '=', ',', ';', 'asm' or 'attribute' before 'void' /usr/include/opencc/opencc.h:131: error: expected '=', ',', ';', 'asm' or 'attribute' before 'const' /usr/include/opencc/opencc.h:143: error: expected '=', ',', ';', 'asm' or 'attribute' before 'opencc' /root/opencc4php/opencc.c: In function 'zif_opencc_open': /root/opencc4php/opencc.c:70: warning: assignment makes pointer from integer without a cast /root/opencc4php/opencc.c: In function 'zif_opencc_error': /root/opencc4php/opencc.c:143: warning: assignment makes pointer from integer without a cast /root/opencc4php/opencc.c: In function 'zif_opencc_convert': /root/opencc4php/opencc.c:176: warning: assignment makes pointer from integer without a cast make: *** [opencc.lo] Error 1

pkujhd commented 6 years ago

请告知opencc的版本

SamHz commented 4 years ago
root@cust:/home/cust/opencc4php# make && make install
/bin/bash /home/cust/opencc4php/libtool --mode=compile cc  -I. -I/home/cust/opencc4php -DPHP_ATOM_INC -I/home/cust/opencc4php/include -I/home/cust/opencc4php/main -I/home/cust/opencc4php -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/usr/include/opencc  -DHAVE_CONFIG_H  -g -O2   -c /home/cust/opencc4php/opencc.c -o opencc.lo 
libtool: compile:  cc -I. -I/home/cust/opencc4php -DPHP_ATOM_INC -I/home/cust/opencc4php/include -I/home/cust/opencc4php/main -I/home/cust/opencc4php -I/usr/include/php/20160303 -I/usr/include/php/20160303/main -I/usr/include/php/20160303/TSRM -I/usr/include/php/20160303/Zend -I/usr/include/php/20160303/ext -I/usr/include/php/20160303/ext/date/lib -I/usr/include/opencc -DHAVE_CONFIG_H -g -O2 -c /home/cust/opencc4php/opencc.c  -fPIC -DPIC -o .libs/opencc.o
/home/cust/opencc4php/opencc.c: In function ‘zif_opencc_error’:
/home/cust/opencc4php/opencc.c:121:8: error: expected expression before ‘opencc_error’
  msg = opencc_error();
        ^
Makefile:194: recipe for target 'opencc.lo' failed
make: *** [opencc.lo] Error 1
sudo apt-get install libopencc-dev -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libopencc-dev is already the newest version (0.4.3-2build1).
0 upgraded, 0 newly installed, 0 to remove and 259 not upgraded.

类似的错误,请问这个怎么处理? ubuntu16.04 和 php7.1.3

pkujhd commented 4 years ago

OpenCC 需要1.0.1以上的版本