Sorry to dig this up, but I have this issue that's driving me mad.
I know that this sound stupid, but I'm having linker errors when I try to bind a class to Squirrel. At first I thought I forgot to link to some libraries, but that was not it. I checked 100 times if Squirrel and SqPlus are build with the same parameters as my application, and their are - the same calling convention, both using the same runtime library version... And linker returns only errors about the binding code, initializing and destroying VM compiles, links and works.
I tried to bind Ogre::Vector3 class like in tutorial, also checked it with any other classes, results are always the same.
EDIT:
And another strange thing, I tried this:
- Code: Select all
SquirrelObject helloWorld = SquirrelVM::CompileBuffer(_T("print(\"Hello World\");"));
SquirrelVM::RunScript(helloWorld);
and I got a linker error about SquirrelVM::CompileBuffer, but SquirrelVM::RunScript links, and they are the methods of the same class...
I'm totally lost, If someone can help me with this in any way, I would be really grateful.
Here's the linker output:
- Code: Select all
Error 1 error LNK2019: unresolved external symbol "public: static class SquirrelObject __cdecl SquirrelVM::CreateFunction(class SquirrelObject &,int (__cdecl*)(struct SQVM *),wchar_t const *,wchar_t const *)" (?CreateFunction@SquirrelVM@@SA?AVSquirrelObject@@AAV2@P6AHPAUSQVM@@@ZPB_W3@Z) referenced in function "class SquirrelObject __cdecl SqPlus::RegisterClassType<class cMonster>(struct SQVM *,wchar_t const *,wchar_t const *)" (??$RegisterClassType@VcMonster@@@SqPlus@@YA?AVSquirrelObject@@PAUSQVM@@PB_W1@Z) cGameWorld.obj
- Code: Select all
Error 2 error LNK2019: unresolved external symbol "int __cdecl SqPlus::CreateClass(struct SQVM *,class SquirrelObject &,void *,wchar_t const *,wchar_t const *)" (?CreateClass@SqPlus@@YAHPAUSQVM@@AAVSquirrelObject@@PAXPB_W3@Z) referenced in function "class SquirrelObject __cdecl SqPlus::RegisterClassType<class cMonster>(struct SQVM *,wchar_t const *,wchar_t const *)" (??$RegisterClassType@VcMonster@@@SqPlus@@YA?AVSquirrelObject@@PAUSQVM@@PB_W1@Z) cGameWorld.obj
- Code: Select all
Error 3 error LNK2019: unresolved external symbol "public: int __thiscall SquirrelObject::SetValue(wchar_t const *,int)" (?SetValue@SquirrelObject@@QAEHPB_WH@Z) referenced in function "void __cdecl SqPlus::setupClassHierarchy(class SquirrelObject)" (?setupClassHierarchy@SqPlus@@YAXVSquirrelObject@@@Z) cGameWorld.obj
- Code: Select all
Error 4 error LNK2019: unresolved external symbol "public: class SquirrelObject __thiscall SquirrelObject::GetValue(wchar_t const *)const " (?GetValue@SquirrelObject@@QBE?AV1@PB_W@Z) referenced in function "void __cdecl SqPlus::setupClassHierarchy(class SquirrelObject)" (?setupClassHierarchy@SqPlus@@YAXVSquirrelObject@@@Z) cGameWorld.obj
- Code: Select all
Error 5 error LNK2019: unresolved external symbol "public: int __thiscall SquirrelObject::SetValue(wchar_t const *,class SquirrelObject const &)" (?SetValue@SquirrelObject@@QAEHPB_WABV1@@Z) referenced in function "void __cdecl SqPlus::setupClassHierarchy(class SquirrelObject)" (?setupClassHierarchy@SqPlus@@YAXVSquirrelObject@@@Z) cGameWorld.obj
- Code: Select all
Error 6 error LNK2019: unresolved external symbol "public: int __thiscall SquirrelObject::Exists(wchar_t const *)const " (?Exists@SquirrelObject@@QBEHPB_W@Z) referenced in function "void __cdecl SqPlus::setupClassHierarchy(class SquirrelObject)" (?setupClassHierarchy@SqPlus@@YAXVSquirrelObject@@@Z) cGameWorld.obj
Thanks in advance.