[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Will Lua work in this situation?
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Fri, 15 May 2009 14:08:01 +0200
2009/5/14 Lloyd <lloyd@cdactvm.in>:
> I again tried with changing the "my_c_function" like this
>
> int __declspec(dllexport) my_c_function(lua_State* L)
> {
> const char* name = luaL_checkstring(L, 1);
> printf("Hello %s!\n", name);
> return 0;
> }
>
> Again I am getting the same error message. Where am I making mistake?
Are you compiling your file as C or as C++ ? If your source file is a
C++ file you should write:
extern "C" __declspec(dllexport) int my_c_function(lua_State* L)
{
const char* name = luaL_checkstring(L, 1);
printf("Hello %s!\n", name);
return 0;
}