I'm getting started with lua. I have a very simple project but I can't get it to run. I keep getting the same error: fatal error LNK1107: file broken or damaged: cannot read at 0x2C3C file: lua.h line:1
help would be greatly appreciated
thanks in advance
c++ code
#include <iostream>
extern "C"
{
#include "lua.h"
#include "lualib.h"
#include "laux开发者_如何学编程lib.h"
#include "luaconf.h"
}
int main()
{
int s=0;
lua_State *L = lua_open();
// load the libs
luaL_openlibs(L);
//run a Lua scrip here
luaL_dofile(L,"foo.lua");
printf("\nI am done with Lua in C++.\n");
lua_close(L);
return 0;
}
lua code
io.write("Please enter your name: ")
name = io.read() -- read input from user
print ("Hi " .. name .. ", enjoy hacking with Lua");
It seems you're trying to link a header file into your program.
精彩评论