Author Topic: rev 4649 doesn't build on linux  (Read 28985 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
rev 4649 doesn't build on linux
« on: November 20, 2007, 11:29:01 pm »
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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: rev 4649 doesn't build on linux
« Reply #1 on: November 20, 2007, 11:51:35 pm »
I just compiled it on linux without problems.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: rev 4649 doesn't build on linux
« Reply #2 on: November 21, 2007, 08:26:47 am »
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...?!
« Last Edit: November 21, 2007, 08:48:56 am by MortenMacFly »
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: rev 4649 doesn't build on linux
« Reply #3 on: November 21, 2007, 09:39:09 am »
Sounds like a 64-bit portability issue. Killerbot: are you compiling for 64-bit?
Be patient!
This bug will be fixed soon...

bludo

  • Guest
Re: rev 4649 doesn't build on linux
« Reply #4 on: November 21, 2007, 09:57:01 am »
Hello, I have the same problem on a x86_64 too and my version of gcc is 4.1.2

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: rev 4649 doesn't build on linux
« Reply #5 on: November 21, 2007, 10:27:34 am »
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: rev 4649 doesn't build on linux
« Reply #6 on: November 21, 2007, 02:00:15 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

bludo

  • Guest
Re: rev 4649 doesn't build on linux
« Reply #7 on: November 21, 2007, 02:22:10 pm »
That is the question because it was the same for me !

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: rev 4649 doesn't build on linux
« Reply #8 on: November 21, 2007, 03:11:40 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: rev 4649 doesn't build on linux
« Reply #9 on: November 21, 2007, 03:13:09 pm »
I think Squirrel was 64 bit compatible, if I remember correctly that was one of the main reasons Yiannis changed to this scripting engine ??

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: rev 4649 doesn't build on linux
« Reply #10 on: November 21, 2007, 03:28:49 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: rev 4649 doesn't build on linux
« Reply #11 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 ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: rev 4649 doesn't build on linux
« Reply #12 on: November 21, 2007, 03:41:07 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: 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: 9694
Re: rev 4649 doesn't build on linux
« Reply #13 on: November 21, 2007, 03:43:34 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:
Code
#ifdef _LP64
    #define _SQ64
#endif
Just after:
Code
#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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

bludo

  • Guest
Re: rev 4649 doesn't build on linux
« Reply #14 on: November 21, 2007, 03:44:33 pm »
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