Sign in to follow this  
spiggo89

tolua++ problems

Recommended Posts

spiggo89    122
I am trying to use toLua++ so I can access my classes from lua. I don't really want to instantiate them in lua, merely use lua scripts to alter them etc. Anyway, I created the following .pkg file from the real object declaration: Object.pkg
$#include <d3dx9.h>

class Object {
    Object();
    Object(int _textureID);
    ~Object();

    void setSize(float sx, float sy);

    D3DXVECTOR2 getSize(void);

    void setTexture(int id);
    int getTexture(void);

    void setAnimationID(int id);
    void setAnimationTime(long time);
    void setCurFrame(int frame);
    int getAnimationID(void);
    long getAnimationTime(void);
    int getCurFrame(void);
};
Object.h
#ifndef _OBJECT_H_
#define _OBJECT_H_

#include <d3dx9.h>

class Object {
private:    
    D3DXVECTOR2 size;
    int textureID;
    float rot;
    int colour;
    int animationID;
    int curFrame;
    long animTime;

public:
    Object();
    Object(int _textureID);
    ~Object();

    void setSize(float sx, float sy);

    D3DXVECTOR2 getSize(void);

    void setTexture(int id);
    int getTexture(void);

    void setAnimationID(int id);
    void setAnimationTime(long time);
    void setCurFrame(int frame);
    int getAnimationID(void);
    long getAnimationTime(void);
    int getCurFrame(void);
};

#endif
and then ran: tolua++.exe -o test.c -H test.h Object.pkg which completed successfully. Now when I include add the .h/.c to my visual studio project, I get the following errors:
1>Compiling...
1>test.c
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(59) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(59) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(59) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(59) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(60) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(87) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(87) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(87) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(87) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(88) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(115) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(115) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(115) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(115) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(116) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(140) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(140) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(140) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(140) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(141) : error C2065: 'tolua_ret' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(164) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(164) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(164) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(164) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(166) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(168) : error C2065: 'delete' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(168) : error C2146: syntax error : missing ';' before identifier 'self'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(168) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(195) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(195) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(195) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(195) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(196) : error C2143: syntax error : missing ';' before 'type'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(197) : error C2143: syntax error : missing ';' before 'type'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(199) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(202) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(202) : error C2223: left of '->setSize' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(202) : error C2065: 'sx' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(202) : error C2065: 'sy' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(228) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(228) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(228) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(228) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(230) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(233) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(233) : error C2223: left of '->getSize' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(269) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(269) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(269) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(269) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(270) : error C2143: syntax error : missing ';' before 'type'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(272) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(275) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(275) : error C2223: left of '->setTexture' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(275) : error C2065: 'id' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(301) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(301) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(301) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(301) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(303) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(306) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(306) : error C2223: left of '->getTexture' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(334) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(334) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(334) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(334) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(335) : error C2143: syntax error : missing ';' before 'type'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(337) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(340) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(340) : error C2223: left of '->setAnimationID' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(340) : error C2065: 'id' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(367) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(367) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(367) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(367) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(368) : error C2143: syntax error : missing ';' before 'type'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(370) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(373) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(373) : error C2223: left of '->setAnimationTime' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(373) : error C2065: 'time' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(400) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(400) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(400) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(400) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(401) : error C2143: syntax error : missing ';' before 'type'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(403) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(406) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(406) : error C2223: left of '->setCurFrame' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(406) : error C2065: 'frame' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(432) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(432) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(432) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(432) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(434) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(437) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(437) : error C2223: left of '->getAnimationID' must point to struct/union
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(464) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(464) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(464) : error C2065: 'Object' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(464) : error C2059: syntax error : ')'
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(466) : error C2065: 'self' : undeclared identifier
1>c:\my documents\visual studio 2008\projects\flur\flur\test.c(466) : fatal error C1003: error count exceeds 100; stopping compilation
any help is greatly appreciated :)

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