Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Revision 5643, fails to compile

(1/3) > >>

oBFusCATed:
Here is the error code:

--- 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&)

--- End code ---

Commenting the code bellow fixes the issue  8) 8) :lol:

--- Code: ---        SqPlus::SQClassDef<wxPoint>("wxPoint").
                emptyCtor().
                staticFuncVarArgs(&wxPoint_OpCmp, "_cmp", "*").
                var(&wxPoint::x, "x").
                var(&wxPoint::y, "y");

--- End code ---

spec: gentoo linux amd64, gcc 4.3.3 c::b head trunk/wxaui branches

Jenna:
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:


--- Code: ---    template<>
    struct TypeInfo<SQInt32>
    {
        const SQChar * typeName;
        TypeInfo() : typeName(sqT("int")) {}
        enum {TypeID=VAR_TYPE_INT,Size=sizeof(SQInt32)};
        operator ScriptVarType() { return ScriptVarType(TypeID); }
    };

--- End code ---

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.

MortenMacFly:

--- 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, [...]

--- End quote ---
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...

mandrav:
From the looks of it, jens' patch looks good to me.

thomas:
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? :)

Navigation

[0] Message Index

[#] Next page

Go to full version