Author Topic: Revision 5643, fails to compile  (Read 12640 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Revision 5643, fails to compile
« on: June 11, 2009, 11:56:43 pm »
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&)

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");

spec: gentoo linux amd64, gcc 4.3.3 c::b head trunk/wxaui branches
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Revision 5643, fails to compile
« Reply #1 on: June 12, 2009, 07:41:59 am »
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); }
    };

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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Revision 5643, fails to compile
« Reply #2 on: June 12, 2009, 09:08:10 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Revision 5643, fails to compile
« Reply #3 on: June 12, 2009, 09:42:03 am »
From the looks of it, jens' patch looks good to me.
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Revision 5643, fails to compile
« Reply #4 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.
Why don't you have a look at Sqbind which seems to be more recent and seems to be about 1/5 the size? :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Revision 5643, fails to compile
« Reply #5 on: June 12, 2009, 09:53:13 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!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Revision 5643, fails to compile
« Reply #6 on: June 12, 2009, 10:05:54 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... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Revision 5643, fails to compile
« Reply #7 on: June 12, 2009, 10:26:36 am »
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); }
    };
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?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Revision 5643, fails to compile
« Reply #8 on: June 12, 2009, 10:40:22 am »
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); }
    };
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Revision 5643, fails to compile
« Reply #9 on: June 12, 2009, 10:44:16 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:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Revision 5643, fails to compile
« Reply #10 on: June 12, 2009, 12:08:26 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Revision 5643, fails to compile
« Reply #11 on: June 12, 2009, 12:13:41 pm »
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)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Revision 5643, fails to compile
« Reply #12 on: June 14, 2009, 01:36:50 pm »
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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Revision 5643, fails to compile
« Reply #13 on: June 30, 2009, 06:28:14 pm »
Might want to look at Scrat project in addition to sqbind
http://sourceforge.net/projects/scrat

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org