lua-users home
lua-l archive

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

Miles Bader escribió:
For my file "foo.i", swig generates "luaopen_foo".  I think swig gets
the name "foo" from the %module commnad in the .i file; do you have a
line like "%module ClassA" in your .i file?

Anyway, since swig generate C code, you can easily look at it and see
what it's doing.  In my version of swig, it outputs some lines like:

   #define SWIG_name      "foo"
   #define SWIG_init      luaopen_foo
   #define SWIG_init_user luaopen_foo_user

... and then later in that file defines:

   #ifdef __cplusplus
   extern "C" {
   SWIGEXPORT int SWIG_init(lua_State* L)

with the reuslt of defining an exported function called "luaopen_foo".
Then, whats the correct way to use that function? When I search the file I find the define SWIG_init luaopen_foo, but when I link I got an error about undefined reference.


-- | Linux, programación, juegos
Have no place I can be since I found Serenity
But you can’t take the sky from me

______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto.