I have a class called LuaInstance... I have been using it for quiet a while, when ever I get a new thing I wish to add to it (so lua can interact with it)
here's the header:
#ifndef LUAINSTANCE_H
#define LUAINSTANCE_H
#include <map>
#include <iostream>
#include <cstring>
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include "../ComponentFactory/ComponentCompiler.h"
#include "../Component/DrawComponent.h"
#include "../../ManiacsMayhem entity testing/entManager.h"
/** \class LuaInstance
* \brief holds several instances of lua_State and grants access to them, using namespaces would have probably been a better
* solution, but there is insufficient information on how they work for me to be confident to use them properly
* @author Michael Crook
* @date 6/4/2012
*/
class LuaInstance
{
public:
// variables
enum instID {
construction = 0,
keyboard = 1,
draw = 2,
character = 3
}; /**< instID enum, this is used to make calling of an instance more readable.. that way when you call an instance, other people reading your code will understand which instance it is */
// functions
/**
* default constructor... creates lua instances and places them into states.
* if you want another luaState you have to add it in here! also don't forget to modify the instID enum
*/
LuaInstance();
~LuaInstance();
/**
* LuaInstance is a singleton, this call will allow you to access LuaInstance
* @return the lua instnace
*/
static LuaInstance *getInstance();
/**
* returns the luaState specified in instEnum
* @param instID instEnum, is used to access the coresponding lua state
* @return a pointer to a lua state
*/
lua_State *getLuaState(instID instEnum) const;
/**
* returns a pointer to an array of strings containing all of the errors thrown during lua execution for given lua state
* this will clear the lua stack, so if you just want to clear the stack don't catch the string it returns
* @param instID inst, the instance ID that you wish to get the stack for
* @return std::string ** a pointer to a string array, "/0" = no more elements
*/
std::string *stackDump(instID inst);
//int compileLua(std::string luaStream, instID instEnum);
/**
* given a number of arguments, if it returns anything AND the lua instance enum this will execute the function
* that has been pushed onto the lua stack (to do so, use pushLuaFunc to push the function, then a pushInt if the function needs it)
* @param int NumArgs (the number of arguments sent to the function), bool hasRet(if the funtion expects a return/you need one), instID instEnum(the instance which has the scope you need to forfill your task)
* @return void *, needs to be cast into the data that you were expecting from the function
*/
void *doLua(int NumArgs, bool hasRet, instID instEnum);
/**
* pushes an int onto the given lua_instance stack
* @param instID instEnum(the instance ID that you wish to use), int data(the data you want added to the stack)
*/
void pushInt(instID instEnum, int data);
///////////////////////////void pushString(instID instEnum, std::string data); /////////////// currently fixing, DO NOT IMPLIMENT
/**
* given an instance and a function name will add it to the given lua instance, if it fails, it will return false
* @param instID instEnum(the instance ID that you wish to use), std::string funcName(the function you wish to pop onto the stack so it can be called)
* @return what does it return
* @todo things that need to be added/moded to function
*/
bool pushLuaFunc(instID instEnum, std::string funcName);
/**
* there really is no need for this instance, luaL_dostring will do the same
* it is included as it uses the instance enum which makes everything so much more clean
* also, the name, do n load makes more sense, so that when people are using the functions
* they will understand that it means that the file is both compiled and done.
* #NOTE# if lua is wrapped in function....end it will not be executed, BUT, the function will
* be added to globals and will be pushable onto the lua stack using pushLuaFunc, if it isn't in a chunk, it will be executed #/NOTE#
* @param instID instEnum, the enumarator for the required lua instance std::string luaString,
* the string which contains the lua file
* @return 0 = success, 1 = fail
*/
int do_n_LoadLua(instID instEnum, std::string luaString);
//void bindObject(instID instEnum, const char *luaVarName, void *object); glitched, impliment later
private:
// variables
std::map<instID, lua_State*> states; /**< holds a pointer to all of the avaiable lua instances */
static LuaInstance *singleton; /**< a pointer to the single instance of LuaInstance */
// functions
//const char* istream_ChunkReader( lua_State *L, void *data, size_t *size );
};
#endif
/*
doxy comments:
functions:
/**
* information on calss
* more lines
* EVEN MORE LINES!
* @param paramaters and what they need to be
* @return what does it return
* @todo things that need to be added/moded to function
*/
// int someFunction();
/*
variables
bool someVar /**< insert variable description here */
When I remove #include "../../ManiacsMayhem entity testing/entManager.h" all of my errors go away.
and here's the implementation:
#include "LuaInstance.h"
LuaInstance* LuaInstance::singleton = 0;
LuaInstance *LuaInstance::getInstance()
{
if(singleton == 0)
{
singleton = new LuaInstance();
}
return(singleton);
}
int LuaInstance::do_n_LoadLua(instID instEnum, std::string funcName)
{
return(luaL_dostring(getLuaState(instEnum), funcName.c_str()));
}
/*
int LuaInstance::compileLua(std::string luaStream, instID instEnum)
{
return(luaL_loadstring(getLuaState(instEnum), luaStream.c_str()));
}
*/
bool LuaInstance::pushLuaFunc(instID instEnum, std::string funcName)
{
bool retVal = true;
lua_getglobal(getLuaState(instEnum), funcName.c_str());
//uncomment for debugging
//int i = lua_type(getLuaState(instEnum), -1);
if (lua_type(getLuaState(instEnum), -1)!=LUA_TFUNCTION)
{
//std::cout << funcName;
retVal = false;
}
return(retVal);
}
/* being worked on
void LuaInstance::pushString(instID instEnum, std::string data)
{
lua_pushstring(getLuaState(instEnum), data.c_str());
// uncomment for debugging
//int i = lua_type(getLuaState(instEnum), -1);
//
}
*/
void LuaInstance::pushInt(instID instEnum, int data)
{
lua_pushnumber(getLuaState(instEnum), data);
///* uncomment for debugging
//int i = lua_type(getLuaState(instEnum), -1);
//*/
}
/*
void LuaInstance::bindObject(instID instEnum, const char *luaVarName, void *object)
{
luabind::globals(getLuaState(instEnum))[luaVarName] = object;
}
*/
void *LuaInstance::doLua(int NumArgs, bool hasRet, instID instEnum)
{
int i, luaData;
int numRet = 0;
int pcallResult;
void *returnVal = NULL;
std::string debugging; // on creation of user UI, at the end of doLua, this will be sent to the error handler, if "" is sent, no errors, if string exists, there's errors
//std::string *debugging2;
//temporary returnTypes
bool b_tmpRet;
int i_tmpRet;
const char * s_tmpRet;
lua_State * ls_tmpRet;
size_t *strSize;
strSize = new size_t();
//NumArgs++; // number of arguments I inteperate as number of objects passed, +1 is for the function that it passes
lua_State *L = getLuaState(instEnum);
if(hasRet)
{
numRet = 1;
}
/*
int a, b, c, d;
a = lua_type(getLuaState(instEnum), 1);
b = lua_type(getLuaState(instEnum), 2);
c = lua_type(getLuaState(instEnum), 3);
d = lua_type(getLuaState(instEnum), 4);
*/
pcallResult = lua_pcall(L, NumArgs, numRet, 0);
/*
int a, b, c, d, e, f, g;
a = lua_type(getLuaState(instEnum), 1);
b = lua_type(getLuaState(instEnum), 2);
c = lua_type(getLuaState(instEnum), 3);
d = lua_type(getLuaState(instEnum), 0);
e = lua_type(getLuaState(instEnum), -1);
f = lua_type(getLuaState(instEnum), -2);
g = lua_type(getLuaState(instEnum), -3);
int aa, bb, cc;
aa = lua_tointeger(getLuaState(instEnum), 1);
bb = lua_tointeger(getLuaState(instEnum), 0);
cc = lua_tointeger(getLuaState(instEnum), 1);
*/
if(hasRet) // if the function is expecting data to be returned
{
luaData = lua_type(getLuaState(instEnum), -1);
if(pcallResult != 0)
{
luaData = 9; // this indicates syntax error in function
}
switch(luaData) // switching the diferent possible return types to be placed inside of
{
case LUA_TNIL:
debugging.append("error running function: ");
debugging.append("no data returned");
break; // nill returned
case LUA_TBOOLEAN:
b_tmpRet = lua_toboolean(getLuaState(instEnum), -1);
memcpy(&returnVal, &b_tmpRet, sizeof b_tmpRet);
break;
case LUA_TLIGHTUSERDATA:
debugging.append("error running function: ");
debugging.append("returning bound objects is currently not supported");
//returnVal = lua_touserdata(L, -1);
case LUA_TNUMBER:
i_tmpRet = lua_tointeger(getLuaState(instEnum), -1);
memcpy(&returnVal, &i_tmpRet, sizeof i_tmpRet);
break;
case LUA_TSTRING:
s_tmpRet = lua_tolstring(getLuaState(instEnum), -1, strSize);
memcpy(&returnVal, &s_tmpRet, *strSize);
break;
case LUA_TTABLE:
debugging.append("error running function: ");
debugging.append("tables not supported");
break;
case LUA_TFUNCTION:
debugging.append("error running function: ");
debugging.append("returning functions not supported");
break;
case LUA_TUSERDATA:
debugging.append("error running function: ");
debugging.append("returning bound objects is currently not supported");
//returnVal = lua_touserdata(L, -1);
break;
case LUA_TTHREAD:
ls_tmpRet = lua_tothread(getLuaState(instEnum), -1);
memcpy(&returnVal, &ls_tmpRet, sizeof ls_tmpRet);
break;
case 9:
debugging.append("error running function: ");
debugging.append(lua_tostring(L, -1));
break;
default:
debugging.append("error running function: ");
debugging.append("return of unknown datatype");
break;
}
lua_pop(L, 1); // pop returned value
}
else
{
if(pcallResult != 0)
{
debugging.append("error running function: ");
debugging.append(lua_tostring(L, -1));
}
}
return(returnVal);
}
LuaInstance::LuaInstance()
{
states.insert(std::make_pair(construction, lua_open()));
states.insert(std::make_pair(keyboard, lua_open()));
states.insert(std::make_pair(draw, lua_open()));
states.insert(std::make_pair(character, lua_open()));
// setting up the compiler to be usable in lua
std::map<instID, lua_State*>::iterator iter;
// opens all lua instances
for(iter = states.begin(); iter != states.end(); ++iter)
{
luaL_openlibs(iter->second);
luabind::open(iter->second);
lua_pcall(iter->second, 0, 0, 0); // initiates pcall
}
//CompCompiler::setupLuaBinds(getLuaState(construction));
//keyBinds::setupLuaBinds(getLuaState(keyboard));
ComponentCompiler::setupLuaBinds(getLuaState(construction));
DrawComponent::setupLuaBinds(getLuaState(draw));
CharacterComponent::setupLuaBinds(getLuaState(character));
}
LuaInstance::~LuaInstance()
{
std::map<instID, lua_State*>::iterator iter;
// closes all lua instances
for(iter = states.begin(); iter != states.end(); ++iter)
{
lua_close(iter->second);
}
}
lua_State *LuaInstance::getLuaState(instID instEnum) const
{
return(states.find(instEnum)->second);
}
std::string *LuaInstance::stackDump(instID inst)
{
lua_State *L = getLuaState(inst);
int top = lua_gettop(L);
if(top == 0)
{
return(NULL);
}
//std::string* stkDmp;
std::string* retVal;
//stkDmp = new std::string[top];
retVal = new std::string[top+1];
int i = 0;
while(lua_gettop(L) != 0) // every time you call lua_remove, it shuffles all of the stack down, thus, eventually the stack will equal 0, thus stack cleared
{
if(lua_isstring(L, 1))
{
retVal = (std::string)lua_tostring(L, 1); // pushes stack element by element onto stkDmp**
}
lua_remove(L, 1); //
i++;
}
retVal[top] = "/0";
return(retVal);
}
here's the header for entManager.h
#pragma once
#include <map>
#include "../src/Tools/LuaInstance.h"
#include "../src/Entity/Entity.h"
// this is a demo class, therefore it isn't following the design patern we have
class entManager
{
public:
entManager(void);
~entManager(void);
//entity stuff
/**
* this will create an entity, if it fails it will return 0, else 1 (so luabind can use)
* @param std::string entityIcz link to the entity file
* @return entity ID (or -1 if failed)
*/
int makeEntity(std::string entityIcz, int entID);
/**
* this will kill the given entity (killing all of it's components)
* @param int entID the entity to kill
* @return will return false if entity does not exist
*/
bool killEntity(int entID);
static void setupLuaBinds(lua_State *L);
private:
std::map<int, Entity*> m_entitys;
};
and implementation:
#include "entManager.h"
entManager::entManager(void)
{
}
entManager::~entManager(void)
{
}
int entManager::makeEntity(std::string entityIcz, int entID)
{
int retVal = 1;
Entity *tmpEnt;
tmpEnt = new Entity(entityIcz, entID); //std::make_pair
if(tmpEnt->getEntId() == -1)
{
//failed
retVal = 0;
}
else
{
m_entitys.insert(std::make_pair(entID, tmpEnt));
}
return(retVal);
}
bool entManager::killEntity(int entID)
{
return(m_entitys.erase(entID)); // this will call the entity's deconstructor which will in return call set
} // all of the components to be deleted on next itteration.
void entManager::setupLuaBinds(lua_State *L)
{
luabind::module(L)
[
luabind::class_<entManager>("entManager")
.def(luabind::constructor<>())
.def("entManager", &entManager::makeEntity)
];
}
although the errors that are produced during compilation are mostly imo bogus (i.e. somthing is causing a big stuff up, which in return is causing working code to apear as if it isn't) here it is:
1>------ Build started: Project: maniacsMayhem, Configuration: Debug Win32 ------
1>Build started 16/04/2012 1:19:42 AM.
1>InitializeBuildStatus:
1> Creating "Debug\maniacsMayhem.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> CharacterCF.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1> Generating Code...
1> Compiling...
1> entManager.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.cpp(32): warning C4800: 'unsigned int' : forcing value to bool 'true' or 'false' (performance warning)
1> LuaInstance.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.cpp(131): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.cpp(67): warning C4101: 'i' : unreferenced local variable
1> entTest.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2065: 'Entity' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2059: syntax error : '>'
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(33): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(20): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(23): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(25): error C2065: 'keyboard' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(26): error C2065: 'draw' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(27): error C2065: 'character' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ',' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(66): error C2065: 'instID' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(100): error C2065: 'instID' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(104): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(25): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(63): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(71): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(3): error C2146: syntax error : missing ',' before identifier 'argv'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(3): error C2065: 'argv' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(3): error C2059: syntax error : ']'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(4): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(7): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(8): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\testing\enttest.cpp(8): fatal error C1004: unexpected end-of-file found
1> Entity.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2065: 'Entity' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(30): error C2059: syntax error : '>'
1>g:\crsm-svn\backbone demo\usin myshit\maniacsmayhem entity testing\entmanager.h(33): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(20): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(23): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(25): error C2065: 'keyboard' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(26): error C2065: 'draw' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(27): error C2065: 'character' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ',' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(28): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(66): error C2065: 'instID' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(100): error C2065: 'instID' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(104): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(25): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(63): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.h(71): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(3): error C2653: 'Entity' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(4): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(14): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(14): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(25): error C2065: 'buffer' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(25): error C2065: 'fileSize' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(25): error C2143: syntax error : missing ',' before ')'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(27): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(27): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(27): error C2065: 'buffer' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(28): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(30): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(30): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(32): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(39): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(39): error C2653: 'LuaInstance' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(40): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(43): error C2653: 'Entity' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(44): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(46): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(48): error C2653: 'Entity' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(49): error C2143: syntax error : missing ';' before '{'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(50): error C2065: 'entId' : undeclared identifier
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(51): error C2143: syntax error : missing ';' before '}'
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(53): error C2653: 'Entity' : is not a class or namespace name
1>g:\crsm-svn\backbone demo\usin myshit\src\entity\entity.cpp(53): fatal error C1903: unable to recover from previous error(s); stopping compilation
1> DrawCF.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1> ComponentCompiler.cpp
1>g:\crsm-svn\backbone demo\usin myshit\src\renderer\light.h(38): warning C4018: '<' : signed/unsigned mismatch
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:20.21
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
luainstance, entity were bug free till now, and through looking through the errors, for instance
1>g:\crsm-svn\backbone demo\usin myshit\src\tools\luainstance.h(20): error C2143: syntax error : missing ';' before '{'
which is referring to this:
class LuaInstance
{ // <------- this is what it is refering to
public:
I believe that the including of the header is in some way doing somthing I shouldn't without me knowing (ive already gone through all of my headers an made sure I have used
#ifndef
#define
#endif
or equivalent.
What I suspect might be the problem is that entManager is including some file, then another file is reclairing it, causing some sort of mumbo jumbo..
I just can't figure out why
note:
during creation of this monster post I found out that if I include entManager in any headder it causes the things that attach to that hedder to expload... I am going to further examine my code, hopefully I can find a solution myself, but I am still going to post as this assignment is due soon and I'm kinda lacking time