一种简单编译的脚本语言
我正在寻找一种简单的脚本语言,只需通过它即可轻松编译 将 .h 文件放在 include 文件夹下,将 .c/.cpp 文件放在源目录下。没有任何 Makefile 的东西。 必须用 C/C++ 而不是 C++ 编写。
好吧,LUA 不起作用,我需要一些可以调用简单方法的东西,它将处理脚本文件。其中没有任何从文件加载的方法,或者至少不使用 stdio.h 的方法。
I'm looking for a simple script language which I can compile easily by just
putting the .h files under an include folder and the .c/.cpp files under a source directory. Something without any Makefile.
Must be written in C/C++ rather C++.
Okay so LUA doesn't work, I need something which I can just call a simple method and it will handle a script file. Without any load from file methods in it, or atleast something which doesn't use the stdio.h.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Lua 是一种简单的轻量级脚本语言,可以轻松嵌入到您的应用程序中。它是用 C 编写的(我不太明白“必须用 C/C++ 而不是 C++ 编写”是什么意思)。
您只需将
src
目录中除lua.c
和luac.c
之外的所有文件添加到您的项目中,它就应该可以工作。请注意,如果您从 C++ 文件包含,则必须将包含内容包装在
extern "C"
块中。以下为我编译和链接。Lua is a simple lightweight scripting language that can be easily embedded into your application. It is written in C (I don't really understand what you mean by "Must be written in C/C++ rather C++").
You can simply add all files from the
src
directory except forlua.c
andluac.c
into your project and it should work.Note that if you're including from a C++ file, you have to wrap includes in
extern "C"
block. The following compiles and links for me.尝试 premake4。比普通的 Makefile 更容易使用,而且确实非常便携。
Try premake4. A lot easier to work with than plain Makefiles, and is quite portable indeed.
我确信我理解您问题的上下文,因为脚本意味着它已被解释,但您想要编译它...会 CH编译器做什么?
希望这有帮助,
此致,
汤姆.
I am sure I understand the context of your question since a script implies that it is interpreted yet you want to compile it...would CH Compiler do?
Hope this helps,
Best regards,
Tom.