Author Topic: Building and debugging the Lua interpreter  (Read 2867 times)

zwanzika.hatzel

  • Guest
Building and debugging the Lua interpreter
« on: July 17, 2022, 11:55:09 pm »
Hi,

I would like to build the Lua interpreter with the aim of stepping thru its code and understand how it works.

I made a new project (console application), added all the c and h files and then built, but I get loads of errors such as the following:

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
obj/Debug/lua-master/onelua.o||in function `lua_newstate':|
/home/user/Desktop/lua-master/lstate.c|355|multiple definition of `lua_newstate'; obj/Debug/lua-master/lstate.o:/home/user/Desktop/lua-master/lstate.c:355: first defined here|
/usr/bin/ld: obj/Debug/lua-master/onelua.o||in function `lua_setcstacklimit':|
/home/user/Desktop/lua-master/lstate.c|99|multiple definition of `lua_setcstacklimit'; obj/Debug/lua-master/lstate.o:/home/user/Desktop/lua-master/lstate.c:99: first defined here|
/usr/bin/ld: obj/Debug/lua-master/onelua.o||in function `lua_newthread':|
/home/user/Desktop/lua-master/lstate.c|286|multiple definition of `lua_newthread'; obj/Debug/lua-master/lstate.o:/home/user/Desktop/lua-master/lstate.c:286: first defined here|
/usr/bin/ld: obj/Debug/lua-master/onelua.o||in function `lua_resetthread':|
/home/user/Desktop/lua-master/lstate.c|346|multiple definition of `lua_resetthread'; obj/Debug/lua-master/lstate.o:/home/user/Desktop/lua-master/lstate.c:346: first defined here|
/usr/bin/ld: obj/Debug/lua-master/onelua.o||in function `lua_close':|
/home/user/Desktop/lua-master/lstate.c|411|multiple definition of `lua_close'; obj/Debug/lua-master/lstate.o:/home/user/Desktop/lua-master/lstate.c:411: first defined here|

Has anyone been successful at building and stepping thru the code of the lua interpreter?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org