lua-users home
lua-l archive

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


Thomas Harning wrote:
On Oct 9, 2008, at 2:41 PM, Brian Macherone wrote:


I'm trying to build the Lua random library under Cygwin and get the
following errors. Any pointers for this novice? (Makefile included below
compilation / linking results)

$ make
gcc -I/cygdrive/j/bsmlab/LuaWindows/Lua-5.1.4/lua-5.1.4/src -ansi
-pedantic -Wal
l -O2    -c -o lrandom.o lrandom.c
gcc -o random.so -shared lrandom.o
lrandom.o:lrandom.c:(.text+0x197): undefined reference to
`_luaL_checkudata'
Windows (sadly) requires that all references be known at link-time... no useful auto-resolve that ld.so does.

You'll have to add the appropriate -llua ONLY for cygwin/mingw builds...

Yep. The cygwin target is annoying in that it's not WIN32 and yet it's
not quite *nix either.

I ended up having to make a minor change in luaconf.h to look for
.dll instead of .so - cygwin does not really care if the suffix is
.dll or .so but all of their libraries are dlls.

Also, you have to put the lua51.dll in the same dir as the lua
executable.

Ralph