[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problem with my first program
- From: "Juan D. Espinoza" <socomm@...>
- Date: Mon, 23 Dec 2002 11:25:23 -0800
Hmm I get the same errors as well on RedHat8.0. I compiled Lua 4.0 From
source the lib is installed at /usr/loca/lib
------ CODE SNIPPET -----
#include <stdio.h>
extern "C" { #include <lua.h> }
int main(int argc, char* argv[ ])
{
lua_State* luaVM = lua_open(0);
if (NULL == luaVM) { printf("Error Initializing lua\n"); return -1; }
char* strLuaInput = "a = 1 + 1;\n";
lua_dostring(luaVM, strLuaInput);
lua_close(luaVM);
return 0;
}
gcc lua.c -o xlua -llua -llualib
----- ERROR SNIPPET -----
lua.c:2: parse error before string constant
lua.c:2: syntax error at '#' token
lua.c: In function `main':
>lua.c:6: `lua_State' undeclared (first use in this function)
lua.c:6: (Each undeclared identifier is reported only once
lua.c:6: for each function it appears in.)
>lua.c:6: `luaVM' undeclared (first use in this function)
I'd appreciate the help.
Thanks in Advance,
--
Juan Espinoza