lua-users home
lua-l archive

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


Hello all,

I'm just getting started with Lua. I want to use it to execute scripts from my C++ apps.

I downloaded (the official, I presume) 5.1 source from the link at lua.org. I'm able to compile all the .c files to a dll/lib, and can compile lua.c and link it with the lib to create a working lua.exe interpreter.

However, my attempts to build the compiler (luac.exe) by compiling luac.c/print.c and linking to the lib produce these link errors:

C:\lang\lua-5.1\src>link /out:luac.exe luac.obj print.obj lua51.lib
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation.  All rights reserved.

luac.obj : error LNK2019: unresolved external symbol _luaM_toobig referenced in function _combine luac.obj : error LNK2019: unresolved external symbol _luaM_realloc_ referenced in function _combine luac.obj : error LNK2019: unresolved external symbol _luaS_newlstr referenced in function _combine luac.obj : error LNK2019: unresolved external symbol _luaD_growstack referenced in function _combine luac.obj : error LNK2019: unresolved external symbol _luaF_newproto referenced in function _combine luac.obj : error LNK2019: unresolved external symbol _luaU_dump referenced in function _pmain print.obj : error LNK2019: unresolved external symbol _luaP_opmodes referenced in function _PrintCode print.obj : error LNK2019: unresolved external symbol _luaP_opnames referenced in function _PrintCode
luac.exe : fatal error LNK1120: 8 unresolved externals

All .c files were compiled with the same (minimal) options, as given in the luavs.bat example that is part of the source distribution:

cl /O2 /W3 /c /DLUA_BUILD_AS_DLL luac.c print.c

I've tried omitting the ...DLL switch here, which toggles declspec(import/export) but errors are the same regardless.

I'm building with the .net 2003 version of the ms tools.

Anyone already done this/fixed this?

thanks -thomas