lua-users home
lua-l archive

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


----- Original Message -----
From: "CRIBBSJ" <CRIBBSJ@oakwood.org>
Subject: More Compiling Adventures

> Well, I tried BCC every which way I could think of, but couldn't get it
> to compile lua.  So, I downloaded mingw and after a lot of trial and
> error, I was able to get lua compiled.  Although I didn't know it at the
> time 'cause I hadn't read his post, I ended up doing something similar
> to David.  I took all the .c and .h files from /include, /src/,
> /src/lib, and /src/lua and put them into one directory.  Then I ran "gcc
> -c *.c" to create the object files.  Next, I moved lua.o up one
> directory.  Then, I moved up to that directory.  Finally, I typed "gcc
> -o lua lua.o ./lua/*.o" and got a working lua.exe!
>

I did the same thing, being new to Makefile, however after a bit of fiddling
I worked out the following...

You need to create two directories under the lua dir. 'bin' and 'lib' (I
think Winzip misses them out when extracting the tar.gz, probably because
they're empty. I'd be worth putting dummy files in the next lua distribution
to make sure they are created)

You need to include the 'lua/include' dir into your C_INCLUDE_PATH so gcc
will find it when compiling (alternatively just drop them in MingW's include
dir)

Now the Makefiles in the 'src', 'src/lib', 'src/luac' and 'src/lua' dirs.
will run.
Still haven't got the Makefile in the 'lua' dir (the main one) to run,
however that isn't necessary to get working code.

'lua.exe' and 'luac.exe' are both placed in the 'lua/bin' dir. when made.

Haven't tried luasocket yet.

Scott