lua-users home
lua-l archive

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

Yes, I actually had that but thought it was more straight forward
to not to have to do the install. But for completeness
after the "make install" the command line is:

  $ gcc hello_world.c -o hello_world -llua -ldl -lm

On Tue, Jun 8, 2010 at 6:40 PM, KHMan <> wrote:
Wink Saville wrote:
Today, was my first stab at trying Lua and I had trouble
getting an embedded Lua hello world C program working.
All of the examples I found on the internet didn't work for me.

I'd also suggest including the command line to compile,
as that was also not obvious. Below is what worked for
me on my Linux box.

Make the linux version:
 $ make linux

make install

then you can simplify your command line

Add the hello_world.c program below to the root of lua source tree
and compile:
 $ gcc hello_world.c -o hello_world -I src/ -L src -llua -ldl -lm

Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia