Luabind and Lua 5.1

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Luabind and Lua 5.1

mempko
Hello,

        I am currently having a problem compiling luabind 0.7 on my mac osx
10.4.5 using lua 5.1 The error I am getting is


../luabind/detail/ref.hpp: In constructor
'luabind::detail::lua_reference::lua_reference(lua_State*)':
../luabind/detail/ref.hpp:50: error: 'LUA_NOREF' was not declared in
this scope
../luabind/detail/ref.hpp: In copy constructor
'luabind::detail::lua_reference::lua_reference(const
luabind::detail::lua_reference&)':
../luabind/detail/ref.hpp:54: error: 'LUA_NOREF' was not declared in
this scope
../luabind/detail/ref.hpp: In member function 'bool
luabind::detail::lua_reference::is_valid() const':
../luabind/detail/ref.hpp:74: error: 'LUA_NOREF' was not declared in
this scope
../luabind/detail/ref.hpp: In member function 'void
luabind::detail::lua_reference::get(lua_State*) const':
../luabind/detail/ref.hpp:94: error: 'LUA_NOREF' was not declared in
this scope
../luabind/detail/ref.hpp: In member function 'void
luabind::detail::lua_reference::reset()':
../luabind/detail/ref.hpp:101: error: 'LUA_NOREF' was not declared in
this scope
../luabind/detail/ref.hpp:102: error: 'LUA_NOREF' was not declared in
this scope
ref.cpp: In function 'int luabind::detail::ref(lua_State*)':
ref.cpp:142: error: 'LUA_REFNIL' was not declared in this scope
make[1]: *** [ref.o] Error 1
make: *** [all] Error 2


LUA_NOREF is not defined and this is clear. my LUA_PATH variable is
/usr/local where I have lua installed in /usr/local/include
/usr/local/bin and usr/local/lib

so I believe my environment LUA_PATH variable is wrong, but for some
silly reason I can't figure out why. I know LUA_NOREF etc.. is defined
in lauxlib.h

so I went and looked in luabind/lua_include.hpp and saw that it looked
like this.

        #ifndef LUA_INCLUDE_HPP_INCLUDED
        #define LUA_INCLUDE_HPP_INCLUDED

        extern "C" {
            #include "lua.h"
        }
        #endif

Which clearly does not include the correct files. So I added the correct
files and that fixes the first error. But when I try to make it again it
gives me

ref.cpp:95: error: expected unqualified-id before 'void'
ref.cpp:95: error: expected `)' before 'void'
ref.cpp:95: error: expected `)' before 'void'
ref.cpp:113: error: expected unqualified-id before 'int'
ref.cpp:113: error: expected `)' before 'int'
ref.cpp:113: error: expected `)' before 'int'
ref.cpp: In function 'int luabind::detail::ref(lua_State*)':
ref.cpp:153: error: expected unqualified-id before '(' token
ref.cpp:157: error: expected unqualified-id before '(' token
make[1]: *** [ref.o] Error 1
make: *** [all] Error 2


Any ideas? Any help would be great.






-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

RE: Luabind and Lua 5.1

yu jiang
hi!

modify the lua_include.h like:

#ifndef LUA_INCLUDE_HPP_INCLUDED
#define LUA_INCLUDE_HPP_INCLUDED

extern "C"
{
        #include "lua.h"
}

#define LUA_NOREF       (-2) //add ...
#define LUA_REFNIL      (-1) //add ...

#endif

and it will work.

_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Luabind and Lua 5.1

mempko
yu jiang wrote:

> hi!
>
> modify the lua_include.h like:
>
> #ifndef LUA_INCLUDE_HPP_INCLUDED
> #define LUA_INCLUDE_HPP_INCLUDED
>
> extern "C"
> {
>     #include "lua.h"
> }
>
> #define LUA_NOREF       (-2) //add ...
> #define LUA_REFNIL      (-1) //add ...
>
> #endif
>
> and it will work.
>
> _________________________________________________________________
> 享用世界上最大的电子邮件系统― MSN Hotmail。  http://www.hotmail.com 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


That did the trick almost! Thanks a lot!
It still would not compile because main.cpp in the test folder had a
problem. But after fixing that It works great!



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Luabind and Lua 5.1

mempko
In reply to this post by mempko
Hello,
        It has become obvious to me that luabind 0.7 is not compatible with lua
5.1

I have been able to compile it with lua 5.1 after hacking at it, but get
the following error during runtime in a program which binds a class.


        PANIC: unprotected error in call to Lua API (attempt to index a
userdata value)

I have found the problem to be in class_rep.cpp in the register_methods
method. So I suppose my question is, when is it expected for luabind to
be compatible with lua 5.1?

Thank you



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Luabind and Lua 5.1

Arvid Norberg

On Mar 20, 2006, at 22:06, mempko wrote:

> Hello,
> It has become obvious to me that luabind 0.7 is not compatible  
> with lua 5.1
>
> I have been able to compile it with lua 5.1 after hacking at it,  
> but get the following error during runtime in a program which binds  
> a class.
>
>
> PANIC: unprotected error in call to Lua API (attempt to index a  
> userdata value)
>
> I have found the problem to be in class_rep.cpp in the  
> register_methods method. So I suppose my question is, when is it  
> expected for luabind to be compatible with lua 5.1?

Does the tests pass for you with lua-5.1?

If they do, could you provide a minimal test case which will trigger  
this error you mention?

thank you!
--
Arvid Norberg




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Luabind and Lua 5.1

Byounghak Yu
In reply to this post by mempko
See the file luaconf.h then you can get some hints from the comment in that
file.
Find the macro LUA_COMPAT_GETN and #define it. :)




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user