开发者

A scripting language to simply compile

开发者 https://www.devze.com 2022-12-18 17:50 出处:网络
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 dir开发者_开发知识库ectory. Something wit

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 dir开发者_开发知识库ectory. 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.


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 for lua.c and luac.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.

extern "C" {
#include <lua.h>
#include <lauxlib.h>
}

int main()
{
    lua_State* L = lua_open();
}


Try premake4. A lot easier to work with than plain Makefiles, and is quite portable indeed.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号