lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



I’ve been stuck on this problem for weeks despite researching forums, tutorials, and Lua/IUP documentation. I’ve been working on updating an abandoned app that uses mostly Lua scripts and one C script that calls the header files. I was content to change the Lua files then run the app’s .exe file to check the results, which worked very well, but now I want to update IUP in order to use some new features as well as be able to compile and debug the code in VSCode (it’d be nice if I could turn the app’s source files into an .exe for other users) but I’m not experienced in technical stuff like that. I just want to get everything working so I can get back to the Lua scripts.


I tried installing but couldn’t get that to work (how can the compiler find the headers without .h files?) and I also tried downloading Lua, IUP, CD, and IM (the versions with .h files) separately and putting them in their own folders as shown on the IUP site. I had some luck with getting a simple C file that “include”s Lua to compile and run (it prints text from a Lua file), but couldn’t get IUP to work. VSCode just couldn’t find it. I tried setting up environment variables like page 6 in this PDF guide ( but it didn’t work and by page 20, I was confused because the file structure and contents of the file I’d downloaded was different than what the PDF said to expect and I didn’t know what to do about it.

The app’s source file folder contained iuplua51.exe. The C file starts with the note “Creates a Lua executable linked to all standard IUP libraries * Based on the Lua stand-alone interpreter for Lua 5.1”. If I opened that and executed the main Lua file, I could launch the app, but then I’d get errors because it couldn’t find global variables defined in the C file.


The folder also contained a .loh file (not sure what that is), and a Makefile that had important-looking instructions such as:


### Targets library directories

gcc_LIBDIRS= -L./lua-5.1/lib -L../iup/lib/mingw3 -L../cd/lib/mingw3 -L../im/lib/mingw3


I tried using “-I”, “-L”, and “-l” in my c_cpp_properties.json and tasks.json files, but only had success with the individually installed Lua, not IUP. The Makefile mentions the variable “gcc_CC=mingw32-gcc.exe” so I went looking for that compiler, but I have x64, so I downloaded that version instead and got it working with VSCode. I have a VSC extension to run Makefiles, but I don’t know much about it or whether running this Makefile could solve my problem somehow and make VSCode/GCC see the dependencies.


Does anyone know how I can get all this stuff working together?


Thank you for your time,