Re: problem with swig
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: problem with swig
- From: Miles Bader <miles@...>
- Date: 2008年2月17日 06:27:32 +0900
"Roger D. Vargas" <luo_hei@yahoo.es> writes:
> 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.
Are you, perchance, calling it from a C++ file? Then you need to
declare it as extern "C", something like:
extern "C" int luaopen_foo (lua_State *);
...
void
setup_lua ()
{
lua_State *L = lua_open();
luaL_openlibs (L); // load standard libraries
luaopen_foo (L); // load the wrapped module
...
}
-Miles
--
The key to happiness
is having dreams. [from a fortune cookie]