lua-users home
lua-l archive

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


Hi Clint,

I have a Windows binary distribution of lua on github here: https:// github.com/winlua/bin. It installs the binaries and the header files as well as a C++ interface called Sol2 (it's an hpp file) and adds environment variables so you can use Lua from the command line.  Release 1 1809a is a little old now but would be your best bet (don't use Release 2). 

The Visual Studio solution‎ for building Lua from source is in https://github.com/WinLua/WinLua-VisualStudio. The github project is quite a mess but you can pilfer the solution/project files from the Visual Studio folder. Feel free to look at Release 2 but it's quite broken and I haven't figured out why. I too am a noob but I've been at it for 5 years!

Hope that helps?

Russ
Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
From: Clinton Reese
Sent: Wednesday, October 23, 2019 5:16 AM
To: lua-l@lists.lua.org
Reply To: Lua mailing list
Subject: -- Hi from a newbie!

--[[


I'm truly a Lua newbie. I'm such a newbie that I don't know if asking newbie questions on this email stream is wasting everyone's precious time. If so, feel free to close this message immediately!

I love the language and think Dr. Roberto Ierusalimschy is a genius, though, because I think that minimalism is the key to reliability in human designs. Plus I think designing a teaching system for a programming language around some aspects of the moon is way cool, and even wise
.
Specifically, right now, I'm trying to compile the Lua 5.3 code from source, on Windows 10, using Visual Studio 2019.

Is that my first mistake? Yeah, I attempt bad humor. I seem to be over my head with these feature-bloated IDE's designed to build and support feature-bloated programs. Perhaps I should switch to Linux or Minix for development.

I copied and pasted the Lua 5.3 source from the website into source files manually. Scripting wizard I ain't. I tried to combine the code with code from:

Specifically:

#include <stdio.h>
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
/* the Lua interpreter */
lua_State* L;
int main ( int argc, char *argv[] )
{
        /* initialize Lua */
        L = lua_open();
        /* load various Lua libraries */
        lua_baselibopen(L);
        luaopen_table(L);
        luaopen_io(L);
        luaopen_string(L);
        luaopen_math(L);
   
        /* cleanup Lua */
        lua_close(L);
        return 0;
}

I got some kind of error about C++ not allowing default-int, I believe.

So, I manually saved the .c files with .cpp files.
Less errors, but I couldn't even seem to find the executable to run it! Comedic!

OK. I tried a new approach:

1. Open new project from existing code
2. Visual C++
3. ProjectFileLocation: C:\Users\cbruc\Desktop\CandLua\10-8-2019
4. Project Name: MoonShine53
5. Add files to the project from these folders: C:\Users\cbruc\Desktop\CandLua\10-8-2019 C:\Users\cbruc\Desktop\Lua53Source (Files with .c extension, not .cpp, yet)
6. Show all files in Solution Explorer
7. Finish

Well, I thought I did this before and got a long list of similar error messages, but now I'm getting the windows-processing-twirly-thing for over 16 minutes.

Thanks in advance for your time.

Thanks,

Clint Reese
 
--]] -- P.S.: My first Lua program shared with the email list!

print("Thanks again!")