[在文件夹./configure --enable-saxon
中运行~/Saxonica/SaxonEEC1.2.1/Saxon.C.API
时成功,下一个命令sudo make
是发生有趣的事情的地方,我得到一些错误,记在下面。
使用Saxon HE 1.2.1做同样的事情就像一个道理,我错过了什么吗?
/bin/bash /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/libtool --mode=compile g++ -I. -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -DPHP_ATOM_INC -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/include -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/main -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/jni -DHAVE_CONFIG_H -g -O2 -c /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp -o php7_saxon.lo libtool: compile: g++ -I. -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -DPHP_ATOM_INC -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/include -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/main -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/jni -DHAVE_CONFIG_H -g -O2 -c /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp -fPIC -DPIC -o .libs/php7_saxon.o /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:20:1: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] }; ^ /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:20:1: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp: In function ‘void zim_Xslt30Processor_callFunctionReturningValue(zend_execute_data*, zval*)’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:1664:29: warning: NULL used in arithmetic [-Wpointer-arith] if(Z_TYPE_P(val) != NULL) { ^~~~ /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp: In function ‘void zim_Xslt30Processor_callFunctionReturningString(zend_execute_data*, zval*)’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:1755:29: warning: NULL used in arithmetic [-Wpointer-arith] if(Z_TYPE_P(val) != NULL) { ^~~~ /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp: In function ‘void zim_Xslt30Processor_callFunctionReturningFile(zend_execute_data*, zval*)’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:1844:29: warning: NULL used in arithmetic [-Wpointer-arith] if(Z_TYPE_P(val) != NULL) { ^~~~ /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp: In function ‘void zim_Xslt30Processor_addPackages(zend_execute_data*, zval*)’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:2154:29: warning: NULL used in arithmetic [-Wpointer-arith] if(Z_TYPE_P(val) != NULL && Z_TYPE_P(val)== IS_STRING) { ^~~~ /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp: In function ‘void zim_Xslt30Processor_setInitialTemplateParameters(zend_execute_data*, zval*)’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/php7_saxon.cpp:2207:29: warning: NULL used in arithmetic [-Wpointer-arith] if(Z_TYPE_P(val) != NULL) { ^~~~
和下一个
/bin/bash /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/libtool --mode=compile cc -I. -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -DPHP_ATOM_INC -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/include -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/main -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/jni -DHAVE_CONFIG_H -g -O2 -c /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c -o SaxonCProcessor.lo libtool: compile: cc -I. -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -DPHP_ATOM_INC -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/include -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/main -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/jni -DHAVE_CONFIG_H -g -O2 -c /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c -fPIC -DPIC -o .libs/SaxonCProcessor.o /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c: In function ‘xsltApplyStylesheet’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c:191:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types] checkForException( *(environi.env), cpp); ^ In file included from /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.h:4:0, from /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c:1: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCGlue.h:214:14: note: expected ‘sxnc_environment * {aka struct <anonymous> *}’ but argument is of type ‘JNIEnv {aka const struct JNINativeInterface_ *}’ const char * checkForException(sxnc_environment *environi, jobject callingObject); ^~~~~~~~~~~~~~~~~ /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c: In function ‘executeQueryToString’: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c:309:24: warning: passing argument 1 of ‘checkForException’ from incompatible pointer type [-Wincompatible-pointer-types] checkForException( *(environi.env), cpp); ^ In file included from /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.h:4:0, from /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCProcessor.c:1: /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/SaxonCGlue.h:214:14: note: expected ‘sxnc_environment * {aka struct <anonymous> *}’ but argument is of type ‘JNIEnv {aka const struct JNINativeInterface_ *}’ const char * checkForException(sxnc_environment *environi, jobject callingObject); ^~~~~~~~~~~~~~~~~
此后运行
sudo make install
,将产生下一个错误
/bin/bash /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/libtool --mode=link cc -DPHP_ATOM_INC -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/include -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/main -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/jni -DHAVE_CONFIG_H -g -O2 -o saxon.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/libsaxon/Saxonica/SaxonEEC1.2.1/Saxon.C.API/modules php7_saxon.lo SaxonProcessor.lo XQueryProcessor.lo XsltProcessor.lo Xslt30Processor.lo XPathProcessor.lo SchemaValidator.lo XdmValue.lo XdmItem.lo XdmNode.lo XdmAtomicValue.lo SaxonCGlue.lo SaxonCProcessor.lo SaxonCXPath.lo -lstdc++ -ldl
libtool: link: cc -shared -fPIC -DPIC .libs/php7_saxon.o .libs/SaxonProcessor.o .libs/XQueryProcessor.o .libs/XsltProcessor.o .libs/Xslt30Processor.o .libs/XPathProcessor.o .libs/SchemaValidator.o .libs/XdmValue.o .libs/XdmItem.o .libs/XdmNode.o .libs/XdmAtomicValue.o .libs/SaxonCGlue.o .libs/SaxonCProcessor.o .libs/SaxonCXPath.o -lstdc++ -ldl -g -O2 -Wl,-soname -Wl,saxon.so -o .libs/saxon.so
cc: error: .libs/SchemaValidator.o: No such file or directory
Makefile:225: recipe for target 'saxon.la' failed
make: *** [saxon.la] Error 1
[在运行〜/ Saxonica / SaxonEEC1.2.1 / Saxon.C.API文件夹中的./configure --enable-saxon时,成功了,下一个命令sudo make是发生有趣的事情的地方,我得到一些错误,.. 。
[php7_saxon.cpp中存在一个错误,这可能是生成问题的原因。为了解决该问题,在此处记录了该问题:saxonica.plan.io/issues/4400