我正在尝试在Windows上构建PHP,以及一个流行的用于处理Excel的C库,LibXL。这个库有一个原生的基于对象的扩展名为php_excel。我正在尝试将后者构建为Windows上的共享DLL,而不是将其静态编译为PHP以供分发。
我的编译起点是为Windows wiki entry构建PHP,我使用的是推荐的Visual Studio2008和Windows SDK6.1。为了在本解释中进一步说明路径,我的参考目录是c:\php-sdk\php53dev\vc9\x86\。对PHP快照的引用显示为文件夹php5.3-x,其中x是快照构建日期时间。
在提取PHP快照之后,我将bin\libxl.dll、include_c\*和lib\libxl.lib添加到deps中的相应文件夹中。
然后,我将php_excel扩展提取到php5.3-x\ext\excel-0.9.1中。
运行buildconf和configure --help可以看到这个扩展。然后我运行:
configure --disable-all --enable-cli --with-excel=shared --disable-zts --disable-isapi --disable-nsapi
nmake以实现动态链接库的VC9非线程安全生成。
在nmake上,我遇到了LibXL中每个头文件的语法错误:
c:\php-sdk\php53dev\vc9\x86\deps\include\enum.h(4) : error C2061: syntax error: identifier 'libxl'
c:\php-sdk\php53dev\vc9\x86\deps\include\enum.h(4) : error C2059: syntax error: ';'
...和php_excel的excel.c源代码中的语法错误:
ext\excel-0.9.1\excel.c(33) : error C2146: syntax error : missing ')' before identifier 'f'
ext\excel-0.9.1\excel.c(33) : error C2061: syntax error : identifier 'f'
ext\excel-0.9.1\excel.c(33) : error C2059: syntax error : ';'
ext\excel-0.9.1\excel.c(33) : error C2059: syntax error : ')'
...例如,下面是来自各自文件的这两个部分:
enum.h
#ifndef ENUM_CPP_H
#define ENUM_CPP_H
namespace libxl { # line 4
...
}
excel.c
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "libxl.h"
#include <stdlib.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/date/php_date.h"
#include "php_excel.h"
#include "zend_exceptions.h"
static long xlFormatBorder(FormatHandle f) # line 33
{
return 1;
}我没有看到语法错误,但假设我在什么地方遗漏了一个明显的步骤?
发布于 2011-05-16 01:15:36
我进行了构建,并拉出了修复构建的请求。查看此处的回收站http://www.php.net/~pierre/
https://stackoverflow.com/questions/6008152
复制相似问题