0

So I've been trying to install the luasql-mysql module for a while now and I keep running into problems. This time when I go to install it gives me this error:

luasql-mysql 2.5.0-1 depends on lua >= 5.1 (5.3-1 provided by VM)
mingw32-gcc -O2 -c -o src/luasql.o -IC:\Program Files\lua-5.3.5\src src/luasql.c - 
Ic:/windows/system32/include
mingw32-gcc -O2 -c -o src/ls_mysql.o -IC:\Program Files\lua-5.3.5\src src/ls_mysql.c - 
Ic:/windows/system32/include
mingw32-gcc -shared -o luasql/mysql.dll src/luasql.o src/ls_mysql.o -Lc:/windows/system32 - 
lmysqlclient C:\Program Files\lua-5.3.5\src/lua53.dll -lm
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lmysqlclient
C:\Program Files\lua-5.3.5\src\lua53.dll: file not recognized: file format not recognized
collect2.exe: error: ld returned 1 exit status

Error: Build error: Failed compiling module luasql/mysql.dll

I'm going to try reinstalling everything and hopefully that works but if anyone knows why I'm getting this problem then I would appreciate the help.

Egor Skriptunoff
  • 23,359
  • 2
  • 34
  • 64
Outflows
  • 163
  • 11
  • 2
    I see a few problems. First, GCC can't find libmysqlclient but it looks like the only place it's searching is C:\Windows\system32. Is there where you have it? The other problem is that GCC is trying to compile lua53.dll as a source file, but it's a DLL and you can't compile it. – Reticulated Spline Mar 23 '20 at 03:52
  • @ReticulatedSpline I've been having trouble figuring out how to search in other locations for files. I tried editing the files themselves to change the #include to be a direct path to the file but even that wasn't working so I just moved the mysql files into the lua src folder. I have a feeling that's why I'm getting all these problems so I'm gonna try restarting from scratch and see if that works. I also put the files in the Windows/system32 folder and that didn't seem to work either for whatever reason. – Outflows Mar 23 '20 at 05:05
  • 3
    a possible problem: the directory path contains a space. Many functions cannot work with directory paths that contain space characters, especially if the `path` string is not quoted – user3629249 Mar 23 '20 at 18:06
  • @user3629249 that was the problem actually. I moved the lua folder to users/public instead (apparently that's the default path that luarocks looks for) and now it's working fine. Thanks for the help – Outflows Mar 24 '20 at 15:50

0 Answers0