You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Russell Haley <ru...@winlua.net> on 2023/01/27 05:37:37 UTC

Lua fails to build

Hi,

I am trying to build the Lua interpreter into the sim:nsh sample code using the menuconfig (Applications->Interpreters->Lua). The Lua interpreter seems to be missing libmath. I tried adding `CFLAGS += -lm` but it didn’t seem to help. Can anyone tell me how to add the Lua interpreter correctly?

Thanks,
Russ

Build failure:

…
	LD:  nuttx
	CC:  -x c allsyms.tmp
	/usr/bin/ld: nuttx.rel: in function `numarith':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lobject.c:80: undefined reference to `pow'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lobject.c:81: undefined reference to `floor'
	/usr/bin/ld: nuttx.rel: in function `luaV_flttointeger':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lvm.c:122: undefined reference to `floor'
	/usr/bin/ld: nuttx.rel: in function `luaV_modf':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lvm.c:755: undefined reference to `fmod'
	/usr/bin/ld: nuttx.rel: in function `luaV_execute':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lvm.c:1372: undefined reference to `pow'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lvm.c:1380: undefined reference to `floor'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lvm.c:1430: undefined reference to `pow'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lvm.c:1438: undefined reference to `floor'
	/usr/bin/ld: nuttx.rel: in function `math_sin':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:41: undefined reference to `sin'
	/usr/bin/ld: nuttx.rel: in function `math_cos':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:46: undefined reference to `cos'
	/usr/bin/ld: nuttx.rel: in function `math_tan':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:51: undefined reference to `tan'
	/usr/bin/ld: nuttx.rel: in function `math_asin':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:56: undefined reference to `asin'
	/usr/bin/ld: nuttx.rel: in function `math_acos':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:61: undefined reference to `acos'
	/usr/bin/ld: nuttx.rel: in function `math_atan':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:68: undefined reference to `atan2'
	/usr/bin/ld: nuttx.rel: in function `math_floor':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:99: undefined reference to `floor'
	/usr/bin/ld: nuttx.rel: in function `math_ceil':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:110: undefined reference to `ceil'
	/usr/bin/ld: nuttx.rel: in function `math_fmod':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:128: undefined reference to `fmod'
	/usr/bin/ld: nuttx.rel: in function `math_modf':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:147: undefined reference to `ceil'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:147: undefined reference to `floor'
	/usr/bin/ld: nuttx.rel: in function `math_sqrt':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:157: undefined reference to `sqrt'
	/usr/bin/ld: nuttx.rel: in function `math_log':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:173: undefined reference to `log'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:178: undefined reference to `log2'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:181: undefined reference to `log10'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:183: undefined reference to `log'
	/usr/bin/ld: /home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:183: undefined reference to `log'
	/usr/bin/ld: nuttx.rel: in function `math_exp':
	/home/osboxes/nuttx86_64/apps/interpreters/lua/lua-5.4.0/src/lmathlib.c:190: undefined reference to `exp'
	/usr/bin/ld: nuttx.rel: in function `lua_array_length':
	/home/osboxes/nuttx86_64/apps/interpreters/luamodules/cjson/lua-cjson/lua_cjson.c:580: undefined reference to `floor'
	collect2: error: ld returned 1 exit status
	make[1]: *** [Makefile:327: nuttx] Error 1
	make[1]: Leaving directory '/home/osboxes/nuttx86_64/nuttx/arch/sim/src'
	make: *** [tools/Unix.mk:516: nuttx] Error 2


Sent from Mail for Windows