GLBasic forum

Main forum => Bug Reports => Topic started by: spacefractal on 2015-Aug-15

Title: lots of dbg() errors when DEBUG enabled. [fixed]
Post by: spacefractal on 2015-Aug-15
When enabling DEBUG does not work at all when using TYPE and objects. Try to compile Android Extras as a example, which its also dont like. When debug is disabled, then its work pretty fine.

Im have to write, DEBUG command will newer work on iOS and on property newer compilers, due the name is allready used. Im recommends to uses STDOUT instead.

Code (glbasic) Select


_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.10.037 SN:73686179 - 3D, NET
Wordcount:1408 commands
compiling:
In file included from D:\glbasic\glbasic\gpc_tempg.cpp:2:
D:\glbasic\glbasic\gpc_temp.h: In member function `virtual void __GLBASIC__::GameInputs::dbg() const':
D:\glbasic\glbasic\gpc_temp.h:309: error: ambiguous overload for 'operator+' in 'DGStr(((const char*)"NAMES_Str:")) + ((const __GLBASIC__::GameInputs*)this)->__GLBASIC__::GameInputs::NAMES_Str'
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note: candidates are: __GLBASIC__::DGStr __GLBASIC__::operator+(int, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(int64, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(float, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(double, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, int) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, int64) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, float) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, double) <near match>
D:\glbasic\glbasic\gpc_temp.h:310: error: ambiguous overload for 'operator+' in 'DGStr(((const char*)"code_Str:")) + ((const __GLBASIC__::GameInputs*)this)->__GLBASIC__::GameInputs::code_Str'
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note: candidates are: __GLBASIC__::DGStr __GLBASIC__::operator+(int, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(int64, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(float, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(double, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, const __GLBASIC__::DGStr&) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, int) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, int64) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, float) <near match>
D:/Programmer/GLBasic_v14/Compiler/platform/Include/glb.h:278: note:                 __GLBASIC__::DGStr __GLBASIC__::operator+(const __GLBASIC__::DGStr&, double) <near match>
....... (shorted)
Title: Re: lots of dbg() errors when DEBUG enabled.
Post by: Kitty Hello on 2015-Aug-16
Can you post the type GameInputs?
Title: Re: lots of dbg() errors when DEBUG enabled.
Post by: kanonet on 2015-Aug-16
I got the same problem in several projects, I think it is because you did not keep array members of types in mind, simplest failing test:
Code (glbasic) Select
TYPE t
array[]
ENDTYPE
Title: Re: lots of dbg() errors when DEBUG enabled.
Post by: spacefractal on 2015-Aug-16
Its happens in all Types used.

So Checkout the Android Extras example (Compiler\platform\android\Android Extras\AndroidSample.app)
Title: Re: lots of dbg() errors when DEBUG enabled.
Post by: kanonet on 2015-Aug-18
Obviously dbg() was only implemented for simple arithmetic type member data types, but not for members that are arrays or other types:
Code (glbasic) Select
//works:
TYPE A
a%
ENDTYPE


//fails:
TYPE B
b[]
ENDTYPE


//fails:
TYPE C
c
ENDTYPE

TYPE D
d AS C
ENDTYPE



EDIT: I can confirm, that it is fixed in 14.006. Well done Gernot! :good: