This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Adding, building and linking Lua in a project #45482
Labels
bug
The issue is a bug, or the PR is fixing a bug
Bug description
My project has to integrate the Lua scripting language to implement user services. For that purpose, I first included its source code to the project, then coded cmake to build this code and to link the library to the final target, and finally invoked the C API of Lua from the main function. This does not work, it failed at compile time and run time.
My environment:
To reproduce the problem
3.1.
main.c
2.2.
prj.conf
2.3.
CMakeLists.txt
west build -b frdm_k64f sample/tfm
Expected behavior
I expect the project compiles and, when flashing and monitoring, the following output is displayed:
Impact
It is absolutely necessary that this works, otherwise my project is useless.
Logs and console output
When building the project, the error shown is:
It seems that zephyr is not able to find the functions
_unlink
,_link
and_times
, so if I add a simple implementation in themain.c
it works:However, once the binary is flashed, a run time error appears:
Additional context
In this repository: https://github.com/Mohren/zephyrlua/tree/master/hello_world_lua5_3_5, the author says that the compilation error is caused by the
os
andio
Lua libs, so he remove them, but this is not a good practice.The text was updated successfully, but these errors were encountered: