【发布时间】:2018-11-29 01:27:59
【问题描述】:
我的电脑环境是:
- Win7Pro 64位
- VS2015
- LuaForWindows_v5.1.5-52.exe
- luarocks-2.4.4-win32
- mysql-installer-community-5.5.60.1.msi(x86)
如何解决安装luasql-mysql时出现的如下错误?如何在命令提示符下解决问题?
c:\Lua\5.1>luarocks install luasql-mysql
MYSQL_INCDIR="C:\MySQL\ConnectorC\inclu de"
MYSQL_LIBDIR="C:\MySQL\ConnectorC\lib" 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 2530R
cts: 99% (2505/2530), 636.01 KiB | 282.00 KiB/s Receiving objects:
100% (2530/2530), 646.09 KiB | 270.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 <new-branch-name>
HEAD is now at 2f2c4eb Rockspecs for new version. cl /MD /O2 -c
-Fosrc/luasql.obj -IC:/Lua/5.1/include src/luasql.c -IC:\MySQL\Con nectorC\include x86용 Microsoft (R) C/C++ 최적화 컴파일러 버전 19.00.24215.1
Copyright (c) Microsoft Corporation. All rights reserved.
luasql.c cl /MD /O2 -c -Fosrc/ls_mysql.obj -IC:/Lua/5.1/include
src/ls_mysql.c -IC:\MySQL \ConnectorC\include x86용 Microsoft (R) C/C++
최적화 컴파일러 버전 19.00.24215.1 Copyright (c) Microsoft Corporation. All
rights reserved.
ls_mysql.c link -dll -def:luasql/mysql.def -out:luasql/mysql.dll
C:/Lua/5.1/lib/lua5.1.lib src/luasql.obj src/ls_mysql.obj
-libpath:C:\MySQL\ConnectorC\lib mysqlclient.lib
Microsoft (R) Incremental Linker Version 14.00.24215.1 Copyright (C)
Microsoft Corporation. All rights reserved.
luasql/mysql.lib 라이브러리 및 luasql/mysql.exp 개체를 생성하고 있습니다.
mysqlclient.lib(my_init.obj) : error LNK2019: __imp__RegCloseKey@4 외부
기호(참 조 위치: _win32_have_tcpip 함수)에서 확인하지 못했습니다.
mysqlclient.lib(my_init.obj) : error LNK2019: __imp__RegEnumValueA@32
외부 기호( 참조 위치: _win_init_registry 함수)에서 확인하지 못했습니다.
mysqlclient.lib(my_init.obj) : error LNK2019: __imp__RegOpenKeyExA@20
외부 기호( 참조 위치: _win32_have_tcpip 함수)에서 확인하지 못했습니다.
mysqlclient.lib(common.obj) : error LNK2019: __imp__EqualSid@8 외부
기호(참조 위 치: "public: bool __thiscall Sid::operator==(class Sid const
&)" (??8Sid@@QAE_NA BV0@@Z) 함수)에서 확인하지 못했습니다.
mysqlclient.lib(common.obj) : error LNK2019:
__imp__GetTokenInformation@20 외부 기호(참조 위치: "public: __thiscall Sid::Sid(void *)" (??0Sid@@QAE@PAX@Z) 함수) 에서 확인하지 못했습니다.
mysqlclient.lib(common.obj) : error LNK2019: __imp__IsValidSid@4 외부
기호(참조 위치: "public: __thiscall Sid::Sid(void *)" (??0Sid@@QAE@PAX@Z)
함수)에서 확인하 지 못했습니다. mysqlclient.lib(common.obj) : error LNK2019:
__imp__LookupAccountNameW@28 외부 기호(참조 위치: "public: __thiscall Sid::Sid(wchar_t const *)" (??0Sid@@QAE@PB_W @Z) 함수)에서 확인하지 못했습니다.
mysqlclient.lib(random.obj) : error LNK2019:
__imp__CryptAcquireContextA@20 외부 기호(참조 위치: "public: __thiscall TaoCrypt::OS_Seed::OS_Seed(void)" (??0OS_Se ed@TaoCrypt@@QAE@XZ) 함수)에서
확인하지 못했습니다. mysqlclient.lib(random.obj) : error LNK2019:
__imp__CryptReleaseContext@8 외부 기호(참조 위치: "public: __thiscall TaoCrypt::OS_Seed::~OS_Seed(void)" (??1OS_Se ed@TaoCrypt@@QAE@XZ)
함수)에서 확인하지 못했습니다. mysqlclient.lib(random.obj) : error LNK2019:
__imp__CryptGenRandom@12 외부 기호( 참조 위치: "public: __thiscall TaoCrypt::RandomNumberGenerator::RandomNumberGene rator(void)"
(??0RandomNumberGenerator@TaoCrypt@@QAE@XZ) 함수)에서 확인하지 못했 습니다.
luasql/mysql.dll : fatal error LNK1120: 10개의 확인할 수 없는 외부 참조입니다.
Error: Build error: Failed installing luasql/mysql.dll in
C:\Lua\5.1\rocks/luasq l-mysql/2.3.5-1/lib/luasql
c:\Lua\5.1>
【问题讨论】:
-
到目前为止你有什么尝试?
-
- mysql 64 位更改为 32 位。版本下降。 (它消失了 32/64 位错误) - C:\MySQL\ConnectorC\lib\vs14\mysqlclient.lib 复制到 C:\MySQL\ConnectorC\lib 文件夹。 - 在 luarocks 之前运行到 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat。 - 管理员命令行等...