开发者

lua + visual c++ 2008: fatal error LNK1107

开发者 https://www.devze.com 2023-02-08 08:51 出处:网络
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 0x2C3Cfile: lua.h lin

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消