Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: killerbot on November 20, 2007, 11:29:01 pm

Title: rev 4649 doesn't build on linux
Post by: killerbot 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
Title: Re: rev 4649 doesn't build on linux
Post by: Jenna on November 20, 2007, 11:51:35 pm
I just compiled it on linux without problems.
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly 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...?!
Title: Re: rev 4649 doesn't build on linux
Post by: mandrav on November 21, 2007, 09:39:09 am
Sounds like a 64-bit portability issue. Killerbot: are you compiling for 64-bit?
Title: Re: rev 4649 doesn't build on linux
Post by: bludo 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
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot 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
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly 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:
Title: Re: rev 4649 doesn't build on linux
Post by: bludo on November 21, 2007, 02:22:10 pm
That is the question because it was the same for me !
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly 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?
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot 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 ??
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly 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...)...
Title: Re: rev 4649 doesn't build on linux
Post by: 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 ?
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly 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.
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly 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:
Title: Re: rev 4649 doesn't build on linux
Post by: bludo 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

Title: Re: rev 4649 doesn't build on linux
Post by: bludo on November 21, 2007, 03:47:41 pm
Ok, thanks for the solution and sorry for my unnecessary reply
Title: Re: rev 4649 doesn't build on linux
Post by: bludo on November 21, 2007, 04:13:51 pm
Finally, It is not sufficient because after compiling squirrel, there are errors during sqplus compilation. Some functions retunrs types and parameters types in SqPlus.cpp must be modified from in to SQInteger to be compatible with squirrel 64 bit support. There are same problems in SquirrelObject.h functions.
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot on November 21, 2007, 04:39:00 pm
at : Diff between revs 3594 and 4648
those :
#ifdef _LP64     
    #define _SQ64    
#endif

got removed.
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 21, 2007, 04:55:48 pm
at : Diff between revs 3594 and 4648
those :
#ifdef _LP64     
    #define _SQ64    
#endif

got removed.
As I said: It's all my fault. :oops:

Edit: killerbot: Will you fix this, please? And please add a C::B marker accordingly (see diff of 4648 to 4649).
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot on November 21, 2007, 05:33:08 pm
I will fix this : so I just need to add those lines again ?
Was this one of our additions [before this weeks update] ??
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot on November 21, 2007, 06:37:09 pm
have done that one adjustment, but there are much more errors now. probably some more things got broken.
Code
../../../../src/include/scripting/sqplus/sqplus.h:346: error: invalid conversion
 from 'int (*)(SQVM*)' to 'SQInteger (*)(SQVM*)'
../../../../src/include/scripting/sqplus/sqplus.h:346: error:   initializing arg
ument 2 of 'static SquirrelObject SquirrelVM::CreateFunction(SquirrelObject&, SQ
Integer (*)(SQVM*), const SQChar*, const SQChar*)'
../../../../src/include/scripting/sqplus/sqplus.h:347: error: invalid conversion
 from 'int (*)(SQVM*)' to 'SQInteger (*)(SQVM*)'
../../../../src/include/scripting/sqplus/sqplus.h:347: error:   initializing arg
ument 2 of 'static SquirrelObject SquirrelVM::CreateFunction(SquirrelObject&, SQ
Integer (*)(SQVM*), const SQChar*, const SQChar*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'void SqPlus::cre
ateInstanceSetGetHandlers(SquirrelObject&)':
../../../../src/include/scripting/sqplus/sqplus.h:377: error: invalid conversion
 from 'int (*)(SQVM*)' to 'SQInteger (*)(SQVM*)'
../../../../src/include/scripting/sqplus/sqplus.h:377: error:   initializing arg
ument 2 of 'static SquirrelObject SquirrelVM::CreateFunction(SquirrelObject&, SQ
Integer (*)(SQVM*), const SQChar*, const SQChar*)'
../../../../src/include/scripting/sqplus/sqplus.h:378: error: invalid conversion
 from 'int (*)(SQVM*)' to 'SQInteger (*)(SQVM*)'
../../../../src/include/scripting/sqplus/sqplus.h:378: error:   initializing arg
ument 2 of 'static SquirrelObject SquirrelVM::CreateFunction(SquirrelObject&, SQ
Integer (*)(SQVM*), const SQChar*, const SQChar*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'char SqPlus::Get
(SqPlus::TypeWrapper<char>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1890: error: cannot convert 'I
NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege
r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'unsigned char Sq
Plus::Get(SqPlus::TypeWrapper<unsigned char>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1891: error: cannot convert 'I
NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege
r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'short int SqPlus
::Get(SqPlus::TypeWrapper<short int>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1892: error: cannot convert 'I
NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege
r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'short unsigned i
nt SqPlus::Get(SqPlus::TypeWrapper<short unsigned int>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1893: error: cannot convert 'I
NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege
r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'int SqPlus::Get(
SqPlus::TypeWrapper<int>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1894: error: cannot convert 'I
NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege
r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'unsigned int SqP
lus::Get(SqPlus::TypeWrapper<unsigned int>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1895: error: cannot convert 'I
NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege
r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'long int SqPlus:                   :Get(SqPlus::TypeWrapper<long int>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1896: error: cannot convert 'I                   NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege                   r, SQInteger*)'
../../../../src/include/scripting/sqplus/sqplus.h: In function 'long unsigned in                   t SqPlus::Get(SqPlus::TypeWrapper<long unsigned int>, SQVM*, int)':
../../../../src/include/scripting/sqplus/sqplus.h:1897: error: cannot convert 'I                   NT*' to 'SQInteger*' for argument '3' to 'SQRESULT sq_getinteger(SQVM*, SQIntege                   r, SQInteger*)'

Hopefully tomorrow or Friday I can take a look at it. Thing is, during the day time currently no 64bit machine available

EDIT : @Morton : were there out places where such things got removed ??
At first sight it doesn't look good for the moment ...

EDIT : we could maybe simplify things by just following this suggestion :
Quote
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.

but in a portable way then, in the makefile and in the cbp files. So probably the old style is better : _LP64 --> _SQ64, but in the current code this seems not to be sufficient.


just by looking at sqplus.h I see that a lot of SQInteger are now replaced by int. Were does SQIntegers put there by the original authors or were that CB adjustments which got lost in the update ??
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 22, 2007, 10:05:28 am
have done that one adjustment, but there are much more errors now. probably some more things got broken.
Oh dear... :-(

EDIT : @Morton : were there out places where such things got removed ??
I need to double-check. I have the following resources: Squirell/SQPlus 2.1.0/1.9 original and C::B revision; Squirell/SQPlus 2.1.1/2.3 original and C::B revision. I am diffing them to see...

EDIT : we could maybe simplify things by just following this suggestion :
Sure, this would probably be a good idea. It also reduces our modifications on the sources.

just by looking at sqplus.h I see that a lot of SQInteger are now replaced by int. Were does SQIntegers put there by the original authors or were that CB adjustments which got lost in the update ??
This seems to hhave been done indeed by Yiannis that time. I think we should ask him and he will hopefully remember. If that's the case we need to replace int by SQInteger again. In addition the same applied to float vs. SQFloat (but only within the focus of SQPlus, not Squirrel).

With regards, Morten.
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 22, 2007, 10:14:56 am
This seems to hhave been done indeed by Yiannis that time. I think we should ask him and he will hopefully remember. If that's the case we need to replace int by SQInteger again. In addition the same applied to float vs. SQFloat (but only within the focus of SQPlus, not Squirrel).
So - it seems Yiannis did that indeed. I will therefore apply the same modifications to SQPlus in SVN. Give me some time and try afterwards... ;-)
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot on November 22, 2007, 10:52:06 am
ok I will .... patience is a virtue  8) 8) 8) 8) 8)
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 22, 2007, 01:46:03 pm
ok I will .... patience is a virtue  8) 8) 8) 8) 8)
So... guess what: I have done that but now C::B crashes on startup with a weired error message that has it's roots in wxScintilla...?!
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 22, 2007, 02:47:40 pm
ok I will .... patience is a virtue  8) 8) 8) 8) 8)
OK - done. Give iot another try, please...
Title: Re: rev 4649 doesn't build on linux
Post by: killerbot on November 22, 2007, 11:50:13 pm
no luck  :

Code
 g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src/include -I../../../../src/include/scripting/include -I../../../../src/include/scripting/sqplus -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT SqPlus.lo -MD -MP -MF .deps/SqPlus.Tpo -c SqPlus.cpp  -fPIC -DPIC -o .libs/SqPlus.o
../../../../src/include/scripting/sqplus/sqplus.h: In function 'SquirrelObject SqPlus::RegisterClassType(SQVM*, const SQChar*, const SQChar*)':
../../../../src/include/scripting/sqplus/sqplus.h:1696: error: call of overloaded 'SetValue(const char [5], int&)' is ambiguous
../../../../src/include/scripting/sqplus/SquirrelObject.h:20: note: candidates are: BOOL SquirrelObject::SetValue(INT, bool) <near match>
../../../../src/include/scripting/sqplus/SquirrelObject.h:21: note:                 BOOL SquirrelObject::SetValue(INT, INT) <near match>
../../../../src/include/scripting/sqplus/SquirrelObject.h:22: note:                 BOOL SquirrelObject::SetValue(INT, FLOAT) <near match>
../../../../src/include/scripting/sqplus/SquirrelObject.h:23: note:                 BOOL SquirrelObject::SetValue(INT, const SQChar*) <near match>
../../../../src/include/scripting/sqplus/SquirrelObject.h:26: note:                 BOOL SquirrelObject::SetValue(const SQChar*, bool)
../../../../src/include/scripting/sqplus/SquirrelObject.h:27: note:                 BOOL SquirrelObject::SetValue(const SQChar*, INT)
../../../../src/include/scripting/sqplus/SquirrelObject.h:28: note:                 BOOL SquirrelObject::SetValue(const SQChar*, FLOAT)
../../../../src/include/scripting/sqplus/SquirrelObject.h:29: note:                 BOOL SquirrelObject::SetValue(const SQChar*, const SQChar*) <near match>
make[4]: *** [SqPlus.lo] Error 1
Title: Re: rev 4649 doesn't build on linux
Post by: keenblade on November 24, 2007, 07:47:58 am
no luck  :
no luck, too. Same error on my x86_64.
Title: Re: rev 4649 doesn't build on linux
Post by: mandrav on November 24, 2007, 09:38:31 am
Fixed in r4667.
Title: Re: rev 4649 doesn't build on linux
Post by: alchemist on November 24, 2007, 11:02:20 am
Fixed in r4667.
\o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/ \o/

BIG THANKS !!!
Title: Re: rev 4649 doesn't build on linux
Post by: pauliusz on November 26, 2007, 10:15:29 am
rev 4673 introduced linker errors when compiling under windows:
Code
Linking dynamic library: devel\codeblocks.dll
Creating library file: devel\libcodeblocks.a
.objs\base\tinyxml\tinywxuni.o: In function `ZN10NullLogger5ClearEv':
D:/Projektai/CodeBlocks/src/include/logger.h:(.text$_ZN11TiXmlString4quitEv[TiXmlString::quit()]+0xb): undefined reference to `TiXmlString::nullrep_'
D:/Projektai/CodeBlocks/src/include/logger.h:(.text$_ZN11TiXmlStringaSEPKc[TiXmlString::operator=(char const*)]+0x23): undefined reference to `TiXmlString::assign(char const*, unsigned int)'
D:/Projektai/CodeBlocks/src/include/logger.h:(.text$_ZN11TiXmlString4initEjj[TiXmlString::init(unsigned int, unsigned int)]+0x5b): undefined reference to `TiXmlString::nullrep_'
D:/Projektai/CodeBlocks/src/include/logger.h:(.text$_ZN11TiXmlStringC1Ev[TiXmlString::TiXmlString()]+0x8): undefined reference to `TiXmlString::nullrep_'
collect2: ld returned 1 exit status
Process terminated with status 1 (4 minutes, 28 seconds)
4 errors, 0 warnings
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 26, 2007, 10:45:21 am
rev 4673 introduced linker errors when compiling under windows:
Can't reproduce. Are you sure you are using up-to-date project files and tried to re-build the tinyxml target? Because there were some modifications recently that could cause the error.
Title: Re: rev 4649 doesn't build on linux
Post by: pauliusz on November 26, 2007, 12:42:18 pm
rev 4673 introduced linker errors when compiling under windows:
Can't reproduce. Are you sure you are using up-to-date project files and tried to re-build the tinyxml target? Because there were some modifications recently that could cause the error.

Project Rebuild fixed this problem... Looks like some changes were not noticed by C::B..?
Title: Re: rev 4649 doesn't build on linux
Post by: MortenMacFly on November 26, 2007, 12:56:32 pm
Project Rebuild fixed this problem... Looks like some changes were not noticed by C::B..?
Yes and no. We have removed the TIXML #define from the builds. This is not recognised on purpose by C::B. You need to do a re-build therefore.