lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
539 stars 191 forks source link

Bug installing luasql-postgresql on Windows? #21

Closed AlexBertrand closed 8 years ago

AlexBertrand commented 9 years ago

Hi, I'm failing to install the postgreSQL rock. Here're my steps:

Using"VS2013 x64 Cross Tools Command Prompt3", and entering the luarocks install luasql-postgres PGSQL_DIR="C:\Program Files\PostgreSQL\9.3" I get the message below.

Installing https://rocks.moonscript.org/luasql-postgres-2.3.0-1.src.rock... Using https://rocks.moonscript.org/luasql-postgres-2.3.0-1.src.rock... switching to 'build' mode cl /MD /O2 -c -Fosrc/luasql.obj -IC:/Program Files/Osmose/Lua/5.1/include/ src/l uasql.c -IC:\Program Files\PostgreSQL\9.3/include Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved.

luasql.c cl /MD /O2 -c -Fosrc/ls_postgres.obj -IC:/Program Files/Osmose/Lua/5.1/include/ src/ls_postgres.c -IC:\Program Files\PostgreSQL\9.3/include Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved.

ls_postgres.c src/ls_postgres.c(374) : error C2057: expected constant expression src/ls_postgres.c(374) : error C2466: cannot allocate an array of constant size 0 src/ls_postgres.c(374) : error C2133: 'to' : unknown size

Error: Build error: Failed compiling object src/ls_postgres.obj


Initially, when entering simply luarocks install luasql-postgres, I had the following message: Error: Could not find expected file pg_config.h, or pg_config.h for PGSQL -- you may have to install PGSQL in your system and/or pass PGSQL_DIR or PGSQL_INCDIR to the luarocks command. Example: luarocks install luasql-postgres PGSQL_DIR=/us r/local

Following the reply from luarocks-developers, this might be a bug in luasql.postgres and I should do a bug report/provide a pull request: http://sourceforge.net/p/luarocks/mailman/message/32917969/

Thanks for the support! Cheers, Alex

echiesse commented 8 years ago

Check this out: https://github.com/keplerproject/luasql/pull/13 (23 Nov 2013)

tomasguisasola commented 8 years ago

This problem was corrected in version 2.3.1. Check #42.