Sign in to follow this  
supercoder74

LuaPlus question

Recommended Posts

supercoder74    154
I have written this code:
#include <stdlib.h>
#include <iostream>
#include <LuaPlus/LuaPlus.h>

using namespace LuaPlus;
using std::cout;
using std::endl;
int main(int argc, char *argv[])
{
    LuaStateOwner owner;
    owner->DoFile("hello.lua");
    
    LuaFunction<int> fn=owner->GetGlobal("fn");
    fn();
    
    system("PAUSE");	
    
    return 0;
}


and it gives me this error: 14 C:\Dev-Cpp\luaplustestmain.cpp conversion from `LuaPlus::LuaObject' to non-scalar type `LuaPlus::LuaFunction<int>' requested. How do I fix this? I know that I could just do something like owner->DoString("fn()"); and just get the return value that way, but is there any differences from calling it from DoString or using LuaFunction<>? Also, are there function pointers in lua? [Edited by - supercoder74 on November 12, 2005 6:26:16 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this