Take the 2-minute tour ×

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 "lauxlib.h"
#include "luaconf.h"

int main()
int s=0;

lua_State *L = lua_open();

// load the libs

//run a Lua scrip here

printf("\nI am done with Lua in C++.\n");


return 0;

lua code

io.write("Please enter your name: ")
name = io.read() -- read input from user
print ("Hi " .. name .. ", enjoy hacking with Lua");
share|improve this question
add comment

1 Answer

It seems you're trying to link a header file into your program.

share|improve this answer
Could you please elaborate a little more? I know I'm supposed to reference these libraries but they're already there, as far as I know. –  hikizume Feb 3 '11 at 10:25
I don't know about projects and such but I think you don't add .h files to them, only .c and .lib and .dll. –  lhf Feb 3 '11 at 10:58
add comment

Your Answer


