user187418
user187418

Reputation:

A scripting language to simply compile

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.

Upvotes: 0

Views: 614

Answers (3)

avakar
avakar

Reputation: 32635

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();
}

Upvotes: 2

t0mm13b
t0mm13b

Reputation: 34592

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.

Upvotes: 0

Kornel Kisielewicz
Kornel Kisielewicz

Reputation: 57535

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

Upvotes: 1

Related Questions