I have GLBasic v15 and works ok, but I can't update to version 15.005, the update works but the version remains in 15.004. I don't know if the next error is fixed in the 15.005 update. This can be related with this other post: http://www.glbasic.com/forum/index.php?topic=11066.0
The bug occurs compiling a TYPE in my code. It's normal code not using inline C++.
// type with some functions
TYPE Dialogos
FUNCTION Iniciar:
// some code...
ENDFUNCTION
// more functions...
ENDTYPE
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.14.721
Wordcount:877 commands
compiling:
In file included from C:\Users\FJMONT~1\AppData\Local\Temp\glbasic\gpc_temp0.cpp:1:
C:\Users\FJMONT~1\AppData\Local\Temp\glbasic\gpc_temp.h: In constructor `__GLBASIC__::Dialogos::Dialogos()':
C:\Users\FJMONT~1\AppData\Local\Temp\glbasic\gpc_temp.h:54: error: expected identifier before '{' token
C:\Users\FJMONT~1\AppData\Local\Temp\glbasic\gpc_temp.h:54: error: expected `(' before '{' token
(Many error lines like the last three....)
Looking at the generated code (gpc_temp.h) I can see the compiling error:
class Dialogos
{
GLB_DECLARE_TYPE_DEBUGGER;
public:
// some code here ...
Dialogos(): // <--- this is bad
{
GLB_IMPLEMENT_TYPE_DEBUGGER;
}
// more code here...
}
The generated code fails because the ":" should not be there. This happens because my TYPE have not any member variables in it. If I put a dummy variable in the TYPE like this, the code compiles and links Ok. This "patch" must be done in each TYPE that does not have variables.
TYPE Dialogos
dummy% // fix glb15 fail
// class with some functions and no variables
FUNCTION Iniciar:
// some code...
ENDFUNCTION
// more functions...
ENDTYPE
The generated code is good now and compiles without errors:
class Dialogos
{
GLB_DECLARE_TYPE_DEBUGGER;
public:
Dialogos(): // <-- this is ok now
REGISTER_MEMBER_DEF(dummy,0)
{
GLB_IMPLEMENT_TYPE_DEBUGGER;
}
}
I hope this can be fixed.
No replies :'( :'(
Hi hardyx,
I´d like to help but the level of the problem you seem to have is beyond my skills.
Never run into this error :D
My Types start normal with variables and then Functions :x
So, is this a bug or a feature? ;)
I have some utility TYPES that doesn't have variables, others are normal types.
Putting a dummy variable works ok, but it's an error in the code generation.
Enviado desde mi SM-A310F mediante Tapatalk
Fixed in next update.
Thank you Gernot!!! :good: