Blazing Code
Blazing Code

Reputation: 25

how to distribute a lua file with c++

I know how to do stuff with Lua states and what not but what i don't understand is how you would distribute the final program with a seperate lua file because say you have a .exe and a lua file in the same directory how would I make it so that it is all one executable like how Löve 2d uses

copy /b 

to append the lua file to the Löve 2d interpreter so it can be distributed. could someone possibly explain how this works.

many thanks Blazing

Upvotes: 0

Views: 233

Answers (1)

Jesper Juhl
Jesper Juhl

Reputation: 31488

You could embed the lua code directly into your C++ source in a raw string literal like so:

const auto lua_code = R"lua(
...lua code here...
)lua";

Upvotes: 2

Related Questions