lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks for the reply,
I got the solution, there was problem with Name Mangling.
Since my dll function is in C++, it is name mangled something like luaopen_test@zx, but my lua is a c library it is looking for just luaopen_test function and unable to find.

solution -
extern "C"
{
__declspec(dllexport) int luaopen_test (lua_State *L)
 {
     printf("Luaopen state\n");
  luaL_openlib(L, "test", testlib, 0);
  return 1;
 }
}



On Wed, Mar 6, 2013 at 7:01 PM, Elias Barrionovo <elias.tandel@gmail.com> wrote:

On Mar 6, 2013 8:20 AM, "Muqtheear S" <muqtheear.s@gmail.com> wrote:
> test.dll:
>
> #define LUA_API __declspec(dllexport)
>
> LUALIB_API int luaopen_test (lua_State *L)
>  {
>      printf("Luaopen state\n");
>   luaL_openlib(L, "test", testlib, 0);
>   return 1;
>  }

I don't know much about DLLs, but you defined your dllexport macro as LUA_API while you're using LUALIB_API. Perhaps that's the problem?