News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

rev 4649 doesn't build on linux

Started by killerbot, November 20, 2007, 11:29:01 PM

Previous topic - Next topic

killerbot

due to squirrel update ?

Quote
inline SQHash HashObj(const SQObjectPtr &key)
{
   switch(type(key)) {
      case OT_STRING:      return _string(key)->_hash;
      case OT_FLOAT:      return (SQHash)((SQInteger)_float(key));
      case OT_BOOL: case OT_INTEGER:   return (SQHash)((SQInteger)_integer(key));
      default:         return hashptr(key._unVal.pRefCounted);  ///<--------------------------------------------
   }
}


Quote
../../../../src/include/scripting/squirrel/sqtable.h: In function 'SQHash HashObj(const SQObjectPtr&)':
../../../../src/include/scripting/squirrel/sqtable.h:21: error: cast from 'SQRefCounted*' to 'SQInteger' loses precision
make[4]: *** [sqfuncstate.lo] Error 1

Jenna

I just compiled it on linux without problems.

MortenMacFly

#2
Quote from: jens on November 20, 2007, 11:51:35 PM
I just compiled it on linux without problems.
For me, too. What compiler are you using?

Edit: I just checked: sqtable.{h/cpp} was not touched at all during the update...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mandrav

Sounds like a 64-bit portability issue. Killerbot: are you compiling for 64-bit?
Be patient!
This bug will be fixed soon...

bludo

Hello, I have the same problem on a x86_64 too and my version of gcc is 4.1.2

killerbot

just did a build on my laptop --> OK

but the laptop is 32 bit, since it seems a pointer to int or the other way around is happening, I think it's a 64 bit issue, because the machine giving problems is a 64 bit one.

Note : before the update squirrel code builded fine on my 64 bit machine

MortenMacFly

Quote from: killerbot on November 21, 2007, 10:27:34 AM
Note : before the update squirrel code builded fine on my 64 bit machine
This part I don't get. Cause really: That part you are mentioning was not modified at all. So how can that be...?! :shock:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

bludo

That is the question because it was the same for me !

MortenMacFly

Quote from: mandrav on November 21, 2007, 09:39:09 AM
Sounds like a 64-bit portability issue. Killerbot: are you compiling for 64-bit?
Could really be. SQ(Plus) is not yet 64bit compatible. There are tons of notes within the code accordingly. ;-)
BTW: killerbot: What happens if you use the -m32 compiler switch?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

I think Squirrel was 64 bit compatible, if I remember correctly that was one of the main reasons Yiannis changed to this scripting engine ??

MortenMacFly

Quote from: killerbot on November 21, 2007, 03:13:09 PM
I think Squirrel was 64 bit compatible, [...]
Squirrel is indeed, but not SQPlus (search for "<TODO> 64-bit" in the code...)...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

maybe one of the types that get translated into one another has changed and those type definitions can be in another file ?

MortenMacFly

Quote from: killerbot on November 21, 2007, 03:31:38 PM
maybe one of the types that get translated into one another has changed and those type definitions can be in another file ?
Ok... this should be SQInteger then... let me check...
But anyways: We cannot rely on 64bit compatibility anyway.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

Quote from: killerbot on November 21, 2007, 03:31:38 PM
maybe one of the types that get translated into one another has changed and those type definitions can be in another file ?
Dammed! Maybe I found the error. Could you do me a favour and add the following code into include\scripting\include\squirrel.h:

#ifdef _LP64
    #define _SQ64
#endif

Just after:

#ifndef SQUIRREL_API
#define SQUIRREL_API extern
#endif

If that's the cause than it's all my fault!!! :roll: :roll: :roll:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

bludo

I have found the solution looking on squirrel forum (one of the threads : http://squirrel-lang.org/forums/thread/746.aspx) . Compiling squirrel on 64 bits platforms requires to define the _SQ64 variable so I have added in squirrel Makefile the flag -D_SQ64 in CXXFLAGS and then the compilation succeed. Is it possible that something have changed in the configuration script or squirrel code source ? Can somebody fix this problem in codeblocks code source ?

Thanks