lots of dbg() errors when DEBUG enabled. [fixed]

Previous topic - Next topic

spacefractal

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)
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

Can you post the type GameInputs?

kanonet

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
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

spacefractal

Its happens in all Types used.

So Checkout the Android Extras example (Compiler\platform\android\Android Extras\AndroidSample.app)
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

kanonet

#4
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:
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64