Closed OpenMIS closed 5 years ago
在Windows上使用Visual Studio能成功编译
1)下载安装Visual Studio社区版在“C++开发”里必须选择:
1> 类似 VC++ 2017 version 15.9 v14.16 latest v141 tools需要1.5G左右。
2> 最新版的Windows SDK 2.5G 左右
2)下载luajit源代码,按官方网站在windows上的编译说明。
luajit官网: http://luajit.org/
官网在Windows上的安装说明:http://luajit.org/install.html#windows
大致步骤如下:
1> 在Windows菜单查找位置输入 Tool或工具,找到
适用于 VS 2017 的 x64 本机工具命令提示 或者 x64 Native Tools Command Prompt for VS 2017
运行它
2> cd 都luajit源代码的解压目录\src
3> 输入msvcbuild.bat 执行
3)先按使用C语言开发Postgresql函数的配置开发环境方法
【重点,32/64位都测试成功】Compiling PostgreSQL extensions with Visual Studio on Windows http://blog.2ndquadrant.com/compiling-postgresql-extensions-visual-studio-windows/
4)配置项目属性
1> VC++目录->包含目录 添加luajit源代码所在的目录
2> 在链接器->附件依赖项添加
C:\你之前luajit编译出来路径\lua51.lib
5)修改源代码
plluaapi.c:
luaP_newfunction函数里的
Datum prosrc, argname; 改为 Datum prosrc, argname = NULL;
plluaspi.c: luaP_execute函数里的
luaL_optinteger(L, 3, 0));
luaL_optlong(L, 3, 0));
修改为 //#if LUA_VERSION_NUM >= 503 luaL_optinteger(L, 3, 0)); //#else // luaL_optlong(L, 3, 0)); //#endif 6)编译pllua源代码 7)部署 1> 把lua51.dll复制到Postgresql的bin目录下或者环境变量Path里能访问到的目录 2> 把pllua.dll复制到Postgresql的lib目录下 3> pllua.control, pllua--1.0.sql复制到Postgresql的share\extension目录下 8)执行SQL: CREATE EXTENSION pllua
(a) I don't understand any of that
(b) this is the old broken version of pllua, please see pllua-ng instead
(c) unfortunately I don't know how to compile that one for windows either (and the use of embedded data for the precompiled script might make it harder). I'm quite happy to accept patches for a windows build of pllua-ng, but I have no windows system myself to develop them on. (Any windows build would have to be something that could be run on a CI platform such as appveyor.)
Request help, how to compile and install on Windows? pllua在Windows上使用Visual Studio能成功编译