iDevGames Forums
Lua causing compiler errors - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Programming Languages & Scripting (/forum-8.html)
+--- Thread: Lua causing compiler errors (/thread-1476.html)



Lua causing compiler errors - NSDuo - Apr 9, 2009 03:33 PM

I've been trying to embed Lua into my game. I heard it was easy to embed and program so I decided to use it over the other scripting languages. I downloaded a pre-built framework, put it into my app, included the nessesary headers, declared my lua state, and used lua_open() to get everything started. Then I decided to compile to make sure that everything is working, I get:

warning in /Users/Home/Library/Frameworks/Lua.framework/Lua, file is not of required architecture

Error: "lua_open()", referenced from:
LuaScript::LuaScript() in script.o
symbol(s) not found
collect2: Id returned 1 exit status

Here is my code:

script.h
Code:
#include <Lua/Lua.h>
#include <Lua/lualib.h>
#include <Lua/lauxlib.h>

class luaScript
{
    private:
    
    // the lua state
    lua_State* whLuaState;
    
    public:
    
    luaScript();
};

script.cpp
Code:
#include "script.h"

luaScript::luaScript()
{
    whLuaState = lua_open();
}

I searched google and no one else seems to have the same problem.

I got the framework from: http://blog.trickyfly.com/?p=20