简体   繁体   中英

How do I set a lua.dll so lua.exe won't ask for it in every directory?

Every time I enter lua my_script.lua in command line, it prompts me for lua53.dll on the same folder. How do I set a path so I won't need to have a copy of the lua library in every folder that I want to run a .lua file? I wonder if it is made via parameters or if I should build my own .exe from the .c files using environment variables, but I don't really know.

I've downloaded the binaries from http://luabinaries.sourceforge.net (v5.3.2 - may 19th) and have put lua.exe inside C:/Windows/System32.

According to this MSDN article , the directory from which the application is loaded is the first location being checked for the DLL file. If you put the DLL next to the location of lua.exe it came with, the DLL should be found and loaded by the system.

It may be better to not put application files into your system folders. Just create a separate folder and put your Lua files (.exe and .dll) there. You can then add that folder to PATH environment variable, so that it can be found when you run it as lua .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM