lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello everyone!

Okay. I bin2c'd a luac'd file. I included the bin2c output in my C++ program, it gave syntax errors, an opening brace at the top and a function call at the bottom. I removed the brace and cut/pasted the func call to my C++ program. Here:

-- CODE/ --
#include <stdio.h>
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include "mtx.luc.h" // bin2c file

int main()
{
	lua_State *L = lua_open();
if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"mtx.luc")==0) lua_pcall(L, 0, 0, 0);
	lua_close(L);
	return 0;
}
-- /CODE --

I run the program but it gives no output. I'm on VC++ 2005 and it compiles just fine.