Hello,
i've come up with a problem recently
Code:class BaseClass
{
public:
int baseVariable;
};
class TestClass : public BaseClass
{
public:
int testVar;
};
Class<TestClass> testClass(vm);
testClass.Var("testVar", &TestClass::testVar); // works
testClass.Var("baseVariable", &TestClass::baseVariable); // isn't working
The problem is that gcc is not accepting variables and functions from inherited classes, im using TDM-GCC 4.6.1-tdm64-1 and 4.7.1 on linux.
Gcc gives me this error while compiling:
Code:
error: no matching function for call to 'Sqrat::Class<TestClass>::Var(const char [13], int BaseClass::*)'
./Test.cpp:12:43: note: candidate is:
..\Squirrel/sqrat/sqrat/sqratClass.h:126:46: note: template<class V> Sqrat::Class& Sqrat::Class::Var(const SQChar*, V C::*) [with V = V, C = TestClass, A = Sqrat::
DefaultAllocator<TestClass>, Sqrat::Class<C, A> = Sqrat::Class<TestClass>, SQChar = char]
It's worth noting that above code compiles fine in Microsoft Visual C++ 2008, unofortunetly i need it on linux.
Is there any way to fix or workaround this?