Here is the error code:
include/scripting/sqplus/sqplus.h: In function 'void SqPlus::RegisterInstanceVariable(SquirrelObject&, void*, T*, const SQChar*, SqPlus::VarAccessType) [with T = int]':
include/scripting/sqplus/sqplus.h:1801: instantiated from 'SqPlus::SQClassDef<TClassType>& SqPlus::SQClassDef<TClassType>::var(VarType TClassType::*, const SQChar*, SqPlus::VarAccessType) [with VarType = int, TClassType = wxPoint]'
/home/obfuscated/projects/codeblocks/brances/wxfnb_to_wxaui/src/sdk/scripting/bindings/sc_wxtypes.cpp:283: instantiated from here
include/scripting/sqplus/sqplus.h:443: error: no matching function for call to 'SqPlus::VarRef::VarRef(void*&, SqPlus::TypeInfo<int>, void*&, void (*)(void*, void*), long unsigned int, SqPlus::VarAccessType&, const SQChar*)'
include/scripting/sqplus/sqplus.h:304: note: candidates are: SqPlus::VarRef::VarRef(void*, SqPlus::ScriptVarType, void*, void (*)(void*, void*), SQInteger, SqPlus::VarAccessType, const SQChar*)
include/scripting/sqplus/sqplus.h:303: note: SqPlus::VarRef::VarRef()
include/scripting/sqplus/sqplus.h:294: note: SqPlus::VarRef::VarRef(const SqPlus::VarRef&)
Commenting the code bellow fixes the issue 8) 8) :lol:
SqPlus::SQClassDef<wxPoint>("wxPoint").
emptyCtor().
staticFuncVarArgs(&wxPoint_OpCmp, "_cmp", "*").
var(&wxPoint::x, "x").
var(&wxPoint::y, "y");
spec: gentoo linux amd64, gcc 4.3.3 c::b head trunk/wxaui branches
The problem seems to be that on 64-bit systems squirrel uses long for the int template, but long and int have different-sizes here.
Adding the following code in sc_base_types.h (namespace SqPlus) works for me:
template<>
struct TypeInfo<SQInt32>
{
const SQChar * typeName;
TypeInfo() : typeName(sqT("int")) {}
enum {TypeID=VAR_TYPE_INT,Size=sizeof(SQInt32)};
operator ScriptVarType() { return ScriptVarType(TypeID); }
};
Other devs (Martin?), please have alook at it, I do not have much experience with squirrel, and I can not test it on Win and or 32-bit at the moment.
Quote from: jens on June 12, 2009, 07:41:59 AM
Other devs (Martin?), please have alook at it, I do not have much experience with squirrel, [...]
Seems OK to my - nice catch btw... I'll try under Windows.
This brings me to another story:
Squirrel and SQPlus have been
massively enhanced and especially re-designed for 64 bit lately. So we should think about an upgrade sooner or later. I already tired that, but the differences were too much for the moment. :-(
Guess we have kind of missed to update that component from time to time...
From the looks of it, jens' patch looks good to me.
Dunno, but Sqplus still seems to build on an ages old version of Squirrel... maybe I'm reading it wrong.
Why don't you have a look at Sqbind which seems to be more recent and seems to be about 1/5 the size? :)
Quote from: thomas on June 12, 2009, 09:48:01 AM
Why don't you have a look at Sqbind [...]
You mean that one:
http://code.google.com/p/sqbind/
???
Didn't know of it until today. BTW: The labels for the project are chosen nicely: "squirrel, binding, simple"... sweet!
Quote from: thomas on June 12, 2009, 09:48:01 AM
Dunno, but Sqplus still seems to build on an ages old version of Squirrel... maybe I'm reading it wrong.
That is correct in principle, but I had a look at it. The new squirrel is interface compatible, so exchanging the version that ships with SQPlus (which is 2.1.1) with the latest one (which is 2.2.2) should be possible without any hassle... in theory... ;-)
Quote from: jens on June 12, 2009, 07:41:59 AM
template<>
struct TypeInfo<SQInt32>
{
const SQChar * typeName;
TypeInfo() : typeName(sqT("int")) {}
enum {TypeID=VAR_TYPE_INT,Size=sizeof(SQInt32)};
operator ScriptVarType() { return ScriptVarType(TypeID); }
};
Humpf. I now get a compilation error:
In file included from C:\Devel\CodeBlocks\src\sdk\compilercommandgenerator.cpp:24:
include/scripting/bindings/sc_base_types.h:90: error: redefinition of `struct SqPlus::TypeInfo<SQInteger>'
include/scripting/sqplus/sqplus.h:180: error: previous definition of `struct SqPlus::TypeInfo<SQInteger>'
But have a look: It's not your addition, but the previous typedef which has always been there...?! Am I missing something?!
Quote from: MortenMacFly on June 12, 2009, 10:26:36 AM
Quote from: jens on June 12, 2009, 07:41:59 AM
template<>
struct TypeInfo<SQInt32>
{
const SQChar * typeName;
TypeInfo() : typeName(sqT("int")) {}
enum {TypeID=VAR_TYPE_INT,Size=sizeof(SQInt32)};
operator ScriptVarType() { return ScriptVarType(TypeID); }
};
Humpf. I now get a compilation error:
In file included from C:\Devel\CodeBlocks\src\sdk\compilercommandgenerator.cpp:24:
include/scripting/bindings/sc_base_types.h:90: error: redefinition of `struct SqPlus::TypeInfo<SQInteger>'
include/scripting/sqplus/sqplus.h:180: error: previous definition of `struct SqPlus::TypeInfo<SQInteger>'
But have a look: It's not your addition, but the previous typedef which has always been there...?! Am I missing something?!
You can try to put my addition in an
#ifdef _SQ64.
Quote from: jens on June 12, 2009, 10:40:22 AM
You can try to put my addition in an #ifdef _SQ64.
Nope, that doesn't work, too. As I said: It's not your addition that produces the error, I get it regularly now - even without your patch. Strange...?! :shock:
Quote from: MortenMacFly on June 12, 2009, 10:44:16 AM
Quote from: jens on June 12, 2009, 10:40:22 AM
You can try to put my addition in an #ifdef _SQ64.
Nope, that doesn't work, too. As I said: It's not your addition that produces the error, I get it regularly now - even without your patch. Strange...?! :shock:
Works for me on linux 64-bit and when compiling in 32-bit pbuilder chroot.
Stops with error without the
#ifdef on 32-bit.
Quote from: MortenMacFly on June 12, 2009, 10:44:16 AM
Quote from: jens on June 12, 2009, 10:40:22 AM
You can try to put my addition in an #ifdef _SQ64.
Nope, that doesn't work, too. As I said: It's not your addition that produces the error, I get it regularly now - even without your patch. Strange...?! :shock:
Do you get it at random places, and the next time you try to compile the same file it succeeds?
If this is the case you cpu/memory is failing (overheating or something similar)
I applied the patch (with ifdef), because I don't get an error on any of my systems with it (64- and 32-bit linux, 32-bit windows), but otherwise all 64-bit builds are broken.
Might want to look at Scrat project in addition to sqbind
http://sourceforge.net/projects/scrat
Tim S