将 Lua 嵌入 C++

编程入门 行业动态 更新时间:2024-10-25 16:23:56
本文介绍了将 Lua 嵌入 C++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个可以在执行过程中交互/调用 Lua 脚本的 C++ 程序.该程序的一个关键概念是完全独立于平台,但我似乎无法找到实际提供某些东西的 Lua 构建.

I want to write a C++-Program that can interact/call Lua-scripts during execution. A key concept of the program is complete platform independence, but I seem to be unable to locate a Lua-build that actually offers something that.

到目前为止,我发现的 Lua 构建要么基于环境变量,要么基于特定的库,例如 .lib.dll.so.来自 lua 的官方 Lua 源也不是我正在寻找的,因为它定义了一个主要的 -功能...

The Lua-builds I found so far are either based on environment-variables or specific libraries like .lib, .dll or .so. The official Lua-source from lua also is not what I'm looking for as it defines a main-function…

是否有一个简单的 - 最好的情况是像 sqlite-amlgamation - Lua-interpreter for C/C++ 没有任何这些依赖项?

Is there a simple - best case would be something like sqlite-amalgamation - Lua-interpreter for C/C++ that doesn't have any of these dependencies?

推荐答案

lua.c 包含 main 并定义了控制台应用程序的入口点.如果您将其从项目中删除,剩下的会构建到独立库中,或者您愿意的话,可以构建动态库.

lua.c contains main and defines the entry point for a console application. If you remove it from the project, whats left builds into a standalone lib, or dynamic library if you prefer, just fine.

这篇关于将 Lua 嵌入 C++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-29 03:41:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/747756.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Lua

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!