Page 1 of 2

File paths: I've tried everything

Posted: Thu Apr 08, 2021 7:47 am
by togFox

Code: Select all

sqlite3 = require("lsqlite3");
The above code in my main.lua works on 4 different PC's (Windows) but doesn't work on a fifth PC and I'm running out of options. It's even harder because I don't own the 5th PC and me making different EXE's and sending is challenging the friendship (not really but you know what I mean.

This is the error when launching:

error loading module 'lsqlite3' from the file '.\lsqlite3.dll':
The specified module could not be found.


The dll is distributed in the zip file. This i literally the 3rd line in main.lua:

Code: Select all

strGameVersion = "0.23"
Slab = require 'Slab'
-- https://github.com/coding-jackalope/Slab/wiki
sqlite3 = require("lsqlite3");
The traceback points to the sqlite3 line. Remember - this works on 4 out of 5 Windows boxes. Run as Administrator has been tried.

I know some ppl don't like EXE's but the zip file with EXE and dll is here: https://github.com/togfoxy/TacticalGridIron/releases

Here is the folder structure - it's flat. No subfolders.
Untitled.png
Untitled.png (8.96 KiB) Viewed 3010 times
What could this possibly be? Are there any VisualStudio or SQLite3 packs that need to also be installed?

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 8:08 am
by grump
Try copying the DLL to the game's save directory.

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 9:36 am
by togFox
That wouldn't explain why distribution works on 4 of the 5 PC's.

I'm leaning towards those PC's having a .net distribution that this one PC does not have.

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 9:58 am
by zorg
Works on my pc too, with win7 so i couldn't reproduce the issue... though the exclusive fullscreen thing did scare the hell out of me.

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 10:18 am
by pgimeno
The whole traceback would be interesting, to see if ./lsqlite3.dll has been tried. Also, the current working directory from the point of view of the application (edit: as returned by love.filesystem.getWorkingDirectory()). Lastly, I don't know whether Windows will always look in ./ for a DLL, but it's something to look into as well.

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 10:35 am
by togFox
So what is the ./ in ./lsqlite3.dll ?? I thought that Is that the location the EXE is in? You can see above that the dll co-exists with the EXE. If I'm misunderstanding what ./ is then this might be super simple to solve.

Photo of a screen because I'm getting this info 2nd hand:
Image


@zorg - thanks for trying and lol at the full screen. :) Glad it works for you. That means it works on 5/6 machines.

PS: exe in the repository is a temporary thing while I can work out how to deploy this before moving to itch.io - when it works. :(

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 10:52 am
by grump
togFox wrote: Thu Apr 08, 2021 9:36 am That wouldn't explain why distribution works on 4 of the 5 PC's.
The point is that the current working directory might be something else than the directory where the .exe is stored. I haven't used Windows in a while so I don't know what kind of error message you would see in that case, but I had this exact problem before. Copying the dll into the save directory should work in any case I think, if love.filesystem.getCRequirePath() contains that directory (I can't remember).

If all else fails, search for "dependency walker", download it and see if there's a missing dependency. Maybe it's one of those seven million different MSVC dlls.

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 11:05 am
by togFox
I've never used the walker before but it did display this when I profiled the exe while executing:
LoadLibraryA(".\lsqlite3.dll") called from "LUA51.DLL" at address 0x00007FF85439683D.
Loaded "LSQLITE3.DLL" at address 0x00007FF8485D0000. Successfully hooked module.
Could my friend have a LUA 5.1 installation/pathing issue?

IDK if this helps - this is on my machine that works. Maybe my friend should run this on their machine?

Image

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 11:14 am
by togFox
Corrupt dll during unzip?

Re: File paths: I've tried everything

Posted: Thu Apr 08, 2021 11:16 am
by grump
Lua is part of LÖVE, that can't be the issue. Try adding MSVCR100.DLL to the game, it's the only thing that could be it if it's a missing dependency.