luasql icon indicating copy to clipboard operation
luasql copied to clipboard

Error when compiling mysql-2.3.5 with rockspec

Open baluballa opened this issue 6 years ago • 6 comments

Added this topic to an other compiling issue #87 . See now _its not the same erro_r. I get this error when try to compile:

link -dll -def:luasql/mysql.def -out:luasql/mysql.dll C:/Program Files (x86)/Lua/5.1/lib/lua5.1.lib src/luasql.obj src/ls_mysql.obj -libpath:C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib\vs14 mysqlclient.lib
Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

  Creating library luasql/mysql.lib and object luasql/mysql.exp
mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _win32_have_tcpip
mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__RegEnumValueA@32 referenced in function _win_init_registry
mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__RegOpenKeyExA@20 referenced in function _win32_have_tcpip
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__EqualSid@8 referenced in function "public: bool __thiscall Sid::operator==(class Sid const &)" (??8Sid@@QAE_NABV0@@Z)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__GetTokenInformation@20 referenced in function "public: __thiscall Sid::Sid(void *)" (??0Sid@@QAE@PAX@Z)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__IsValidSid@4 referenced in function "public: __thiscall Sid::Sid(void *)" (??0Sid@@QAE@PAX@Z)
mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__LookupAccountNameW@28 referenced in function "public: __thiscall Sid::Sid(wchar_t const *)" (??0Sid@@QAE@PB_W@Z)
mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__CryptAcquireContextA@20 referenced in function "public: __thiscall TaoCrypt::OS_Seed::OS_Seed(void)" (??0OS_Seed@TaoCrypt@@QAE@XZ)
mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__CryptReleaseContext@8 referenced in function "public: __thiscall TaoCrypt::OS_Seed::~OS_Seed(void)" (??1OS_Seed@TaoCrypt@@QAE@XZ)
mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__CryptGenRandom@12 referenced in function "public: __thiscall TaoCrypt::RandomNumberGenerator::RandomNumberGenerator(void)" (??0RandomNumberGenerator@TaoCrypt@@QAE@XZ)
luasql/mysql.dll : fatal error LNK1120: 10 unresolved externals

Error: Build error: Failed installing luasql/mysql.dll in C:\Program Files (x86)\Lua\5.1\rocks/luasql-mysql/2.3.5-1/lib/luasql

baluballa avatar Feb 14 '18 00:02 baluballa

You need to add libmysql.lib to your libpath

cgiluadev avatar Feb 22 '18 09:02 cgiluadev

It does not workl!

This is my command:

luarocks install luasql-mysql MYSQL_DIR="C:/Program Files/MySQL/MySQL Server 5.7" MYSQL_INCDIR="C:\temp\mysql-connector\include" MYSQL_LIBDIR="C:\temp\mysql-connector\lib"

This is response:

Installing http://luarocks.org/repositories/rocks/luasql-mysql-2.3.5-1.rockspec... Cloning into 'luasql'... remote: Counting objects: 2530, done. remote: Total 2530 (delta 0), reused 0 (delta 0), pack-reused 2530 Receiving objects: 100% (2530/2530), 646.07 KiB | 446.00 KiB/s, done. Resolving deltas: 100% (1524/1524), done. Note: checking out 'v2.3.5'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 2f2c4eb... Rockspecs for new version. cl /MD /O2 -c -Fosrc/luasql.obj -IC:/Program Files (x86)/Lua/5.1/include src/luasql.c -IC:\temp\mysql-connector\include Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved.

luasql.c cl /MD /O2 -c -Fosrc/ls_mysql.obj -IC:/Program Files (x86)/Lua/5.1/include src/ls_mysql.c -IC:\temp\mysql-connector\include Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved.

ls_mysql.c link -dll -def:luasql/mysql.def -out:luasql/mysql.dll C:/Program Files (x86)/Lua/5.1/lib/lua5.1.lib src/luasql.obj src/ls_mysql.obj -libpath:C:\temp\mysql-connector\lib mysqlclient.lib Microsoft (R) Incremental Linker Version 14.00.24215.1 Copyright (C) Microsoft Corporation. All rights reserved.

Creating library luasql/mysql.lib and object luasql/mysql.exp mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function _win32_have_tcpip mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__RegEnumValueA@32 referenced in function _win_init_registry mysqlclient.lib(my_init.obj) : error LNK2019: unresolved external symbol __imp__RegOpenKeyExA@20 referenced in function _win32_have_tcpip mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__EqualSid@8 referenced in function "public: bool __thiscall Sid::operator==(class Sid const &)" (??8Sid@@QAE_NABV0@@Z) mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__GetTokenInformation@20 referenced in function "public: __thiscall Sid::Sid(void *)" (??0Sid@@QAE@PAX@Z) mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__IsValidSid@4 referenced in function "public: __thiscall Sid::Sid(void *)" (??0Sid@@QAE@PAX@Z) mysqlclient.lib(common.obj) : error LNK2019: unresolved external symbol __imp__LookupAccountNameW@28 referenced in function "public: __thiscall Sid::Sid(wchar_t const *)" (??0Sid@@QAE@PB_W@Z) mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__CryptAcquireContextA@20 referenced in function "public: __thiscall TaoCrypt::OS_Seed::OS_Seed(void)" (??0OS_Seed@TaoCrypt@@QAE@XZ) mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__CryptReleaseContext@8 referenced in function "public: __thiscall TaoCrypt::OS_Seed::~OS_Seed(void)" (??1OS_Seed@TaoCrypt@@QAE@XZ) mysqlclient.lib(random.obj) : error LNK2019: unresolved external symbol __imp__CryptGenRandom@12 referenced in function "public: __thiscall TaoCrypt::RandomNumberGenerator::RandomNumberGenerator(void)" (??0RandomNumberGenerator@TaoCrypt@@QAE@XZ) luasql/mysql.dll : fatal error LNK1120: 10 unresolved externals

Error: Build error: Failed installing luasql/mysql.dll in C:\Program Files (x86)\Lua\5.1\rocks/luasql-mysql/2.3.5-1/lib/luasql

I have downloaded X86 connectors from MySQL, which is in the dir given in command. Command is issued from Adminsitrator Developer Command Prompt for VS2015.

baluballa avatar Mar 02 '18 01:03 baluballa

Sorry to bump an oldish issue but I have the same problem. Looked at a few posts but can't find a fix. Did anyone figure it out?

0wain avatar Apr 10 '18 17:04 0wain

I have the same problem, noone?

sqpp avatar Nov 19 '19 01:11 sqpp

same problem

m3fist0 avatar Feb 28 '21 05:02 m3fist0

Sorry, but I do not have a Windows machine for decades. I cannot help with this issue.

Regards, Tomás

tomasguisasola avatar Feb 28 '21 14:02 tomasguisasola