Php 编译HHVM扩展时缺少头文件

Php 编译HHVM扩展时缺少头文件,php,c++,hhvm,Php,C++,Hhvm,我在这里找到了HHVM的gearman扩展,并想尝试一下,现在当我尝试为HHVM构建它时,我得到了这个错误 vagrant@vagrant-ubuntu-trusty-64:~/hhvm/extension-gearman$ cmake . && make -- Configuring for HHVM API version 20150212 -- gearman Include dir: /usr/include/libgearman -- libgearman librar

我在这里找到了HHVM的gearman扩展,并想尝试一下,现在当我尝试为HHVM构建它时,我得到了这个错误

vagrant@vagrant-ubuntu-trusty-64:~/hhvm/extension-gearman$ cmake . && make
-- Configuring for HHVM API version 20150212
-- gearman Include dir: /usr/include/libgearman
-- libgearman library: /usr/lib/x86_64-linux-gnu/libgearman.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vagrant/hhvm/extension-gearman
[100%] Building CXX object CMakeFiles/gearman.dir/gearman.cpp.o
/home/vagrant/hhvm/extension-gearman/gearman.cpp:17:45: fatal error: hphp/runtime/base/base-includes.h: No such file or directory
 #include "hphp/runtime/base/base-includes.h"
                                             ^
compilation terminated.
make[2]: *** [CMakeFiles/gearman.dir/gearman.cpp.o] Error 1
make[1]: *** [CMakeFiles/gearman.dir/all] Error 2
make: *** [all] Error 2
我的config.cmake文件的内容是

FIND_PATH(GEARMAN_INCLUDE_DIR NAMES gearman.h 
    PATHS /usr/include/libgearman /usr/local/include/libgearman)

FIND_LIBRARY(GEARMAN_LIBRARY NAMES gearman PATHS /usr/lib /usr/local/lib)

IF (GEARMAN_INCLUDE_DIR)
    MESSAGE(STATUS "gearman Include dir: ${GEARMAN_INCLUDE_DIR}")
    MESSAGE(STATUS "libgearman library: ${GEARMAN_LIBRARY}")
ELSE()
    MESSAGE(FATAL_ERROR "Cannot find libgearman library")
ENDIF()

include_directories(${GEARMAN_INCLUDE_DIR})


HHVM_EXTENSION(gearman gearman.cpp)
HHVM_SYSTEMLIB(gearman ext_gearman.php)

target_link_libraries(gearman ${GEARMAN_LIBRARY})
*****编辑****** 我通过用hphp/runtime/ext/extension.h替换hphp/runtime/base/base includes.h修复了上述问题

但现在我在编译过程中遇到了这个错误

[100%] Building CXX object CMakeFiles/gearman.dir/gearman.cpp.o
In file included from /usr/include/hphp/runtime/ext/extension.h:23:0,
                 from /home/vagrant/hhvm/extension-gearman/gearman.cpp:18:
/usr/include/hphp/runtime/vm/native.h: In instantiation of ‘void HPHP::Native::registerBuiltinFunction(const char*, Fun) [with Fun = bool (*)(HPHP::ObjectData*, HPHP::String&)]’:
/home/vagrant/hhvm/extension-gearman/gearman.cpp:351:4:   required from here
/usr/include/hphp/runtime/vm/native.h:368:3: error: static assertion failed: Arguments on builtin function were not understood types
   static_assert(
   ^
/usr/include/hphp/runtime/vm/native.h: In instantiation of ‘void HPHP::Native::registerBuiltinFunction(const char*, Fun) [with Fun = bool (*)(HPHP::ObjectData*, HPHP::String&, long int)]’:
/home/vagrant/hhvm/extension-gearman/gearman.cpp:360:4:   required from here
/usr/include/hphp/runtime/vm/native.h:368:3: error: static assertion failed: Arguments on builtin function were not understood types
make[2]: *** [CMakeFiles/gearman.dir/gearman.cpp.o] Error 1
make[1]: *** [CMakeFiles/gearman.dir/all] Error 2
make: *** [all] Error 2
ta*, HPHP::String&, long int)]’:
/home/vagrant/hhvm/extension-gearman/gearman.cpp:360:4:   required from here
/usr/include/hphp/runtime/vm/native.h:368:3: error: static assertion failed: Arguments on builtin function were not understood types
make[2]: *** [CMakeFiles/gearman.dir/gearman.cpp.o] Error 1
make[1]: *** [CMakeFiles/gearman.dir/all] Error 2
make: *** [all] Error 2

好的,我自己修复了它,在HHVM3.6和3.7的新版本中,传递的函数应该是指针字符串常量,而不仅仅是字符串,我必须替换它

bool HHVM_METHOD(GearmanWorker, addServer, String& host, int64_t port) {...
用这个

bool HHVM_METHOD(GearmanWorker, addServer, const String& host, int64_t port) {...