Skip to main content
gamedev.net
🔒 Locked

Luna Problem

Started by Crypter 0 replies 950+ views
Original Post
Crypter
Crypter
Hey everyone, I have an odd problem integrating the Luna library with Lua. This is where the problem is at:

class Account {

/* snip */

  Account(lua_State *L)      { m_balance  = luaL_checknumber(L, 1); }
  int deposit (lua_State *L) { /* m_balance += luaL_checknumber(L, 1); */ return 0; }
  int withdraw(lua_State *L) { /* m_balance -= luaL_checknumber(L, 1); */ return 0; }
  int balance (lua_State *L) { /* lua_pushnumber(L, m_balance); */ return 1; }

/* etc... (/


With the above code as-is, I can compile and link everything together perfectly. However, if I uncomment any of those lines (Including the ones that reference luaL_checknumber) I get unresolved external linker errors on luaL_checknumber and lua_pushnumber. My confusion is... How can I be getting unresolved errors with luaL_checknumber if the first call to it works fine? o.0 Am I missing something? :/ Thanks for any help :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.