c++ - Weird error when defining variables -


so, i'm trying use lua c api on game, i'm having errors defining variables in .cpp file

i have library called clua.h define of stuff i'm using in following code, , compiles fine. (i not sharing it, because it's pretty valuable , highly sought after game i'm using in, don't want else have work, either way there's no problem library)

#include <iostream> #include <windows.h> #include <string> #include "clua.h"  using namespace std;  void clua::init(){ lua_tolstring = (lua_tolstring)0x00517f70; lua_getfield = (lua_getfield)0x00516d70; lua_pcall = (lua_pcall)0x00517340; } 

for starters, on #include line, i'm getting error called "pch warning" on #

then, when define of lua states farther down, on = sign, error saying expected identifier

if understanding issue correctly, looks naming variables same class name. example, cannot name int variable 'int'.

so, if class name 'lua_tolstring', must name variable else. (even if it's different mixed case name) example:

lua_tolstring lua_tolstring; //bad lua_tolstring variablename; //good 

then used such:

variablename = (lua_tolstring)0x00517f70; 

my best guess variable trying set in clua class not named 'lua_tolstring'. seeing header file help. in case, double check accessing right variable. (variable names case sensitive!)


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -