Re: program works for 32bit but not for 64.

Ryan Pavlik <[email protected]> Wed, 12 Oct 2011 18:10:15 -0500
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CABMFTE-xCBz+Vwm=xCGt8RaH7aB1UhwYyPaFc7sOgR85a9vCew@mail.gmail.com>
Does this happen if you use my branch of luabind?
https://github.com/rpavlik/luabind Among other things, I modified it to use
boost typetraits to determine what the integer types are, so dodging the
"incomplete list" issue that might be contributing to what you're seeing.

Ryan

On Wed, Oct 12, 2011 at 5:36 PM, Nigel Atkinson <[email protected]>wrote:

> It might be useful to check the return value of luaL_dostring and if it's
> not zero, print out the string at the top of the stack.  My guess is that it
> will say something along the lines of no overload found.
>
> What's the size of size_t on Win64? long? long long?
>
> Nigel Atkinson
>
> On 13/10/2011, at 8:27 AM, Stephen Blackwell - Applications Engineering
> wrote:
>
> Below is a test-program I have been using.****
> ** **
> I’m compiling in Visual Studio 2008 on a 64 bit Windows 7 box and I have
> 5.1.4 of lua. Luabind seems to be 0.9.1.****
> ** **
> When I compile for a 64 bit platform and I typedef MY_TYPE to int, the
> program works. If I typedef it to size_t, greet never gets called****
> When I compile for a 32 bit platform both cases work. (obviously since int
> and size_t are then the same size)****
> ** **
> Does anyone have any suggestions for 64bit?****
> ** **
> Thanks,****
> Steve****
> ** **
> #include <iostream>****
> #include <luabind/luabind.hpp>****
> using namespace std;****
> ** **
> // int works, size_t doesn't.****
> typedef size_t MY_TYPE;****
> ** **
> class NP {****
> public:****
>       NP(MY_TYPE number) : m_number(number) {}****
> ** **
>       MY_TYPE greet(string& s, string& t)****
>       {****
>             cout << s << m_number << t << endl;****
>             return m_number;****
>       }****
> private:****
>       MY_TYPE m_number;****
> };****
> ** **
> int main()****
> {****
>       using namespace luabind;****
> ** **
>       lua_State *myLuaState = lua_open();****
> ** **
>       open(myLuaState);****
> ** **
>       module(myLuaState)****
>       [****
>             class_<NP>("NumberPrinter")****
>             .def(constructor<MY_TYPE>())****
>             .def("greet", &NP::greet)****
> ** **
>       ];****
> ** **
>       luaL_dostring(myLuaState,****
>             "Print2000 = NumberPrinter(2000)\n"****
>             "Print2000:greet(\"Hello \", \" world!\")\n"****
>             );****
> ** **
>       std::cout << "sizeof(LUA_INTEGER) = " << sizeof(LUA_INTEGER) <<
> std::endl;****
>       std::cout << "sizeof(int) = " << sizeof(int) << std::endl;****
>       std::cout << "sizeof(long) = " << sizeof(long) << std::endl;****
> ** **
>       lua_close(myLuaState);****
> ** **
>       return 0;****
> }****
>
>
>
> Privileged/Confidential Information may be contained in this email.  If you
> are not the addressee indicated in this email (or responsible for delivery
> of the message to such person), you may not copy or deliver this email to
> anyone.  In such case, you should destroy this email and kindly notify the
> sender by phone at (386) 267-2936.  Please advise immediately if you or
> your employer do not consent to emails of this kind. Not for release to
> foreign persons: controlled under U.S. Federal Regulations. Opinions,
> conclusions and other information in this email that do not relate to the
> official business of Raydon Corporation shall be understood as neither given
> nor endorsed by it.
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
>
> http://p.sf.net/sfu/splunk-d2d-oct_______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>
>
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>
>


-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

[email protected]
http://academic.cleardefinition.com

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user