PDA

View Full Version : Errors while setting up my own project



chronozphere
25-06-2011, 01:19 PM
Hey,

I'm trying to set up my own ZenGL project, but after moving the zengl source files and setting the paths, i get this error:



G:\proj\defender\zengl\src\zgl_application.pas(70, 31) Error: Incompatible types: got "app_Init;" expected "<procedure variable type of procedure;Register>"
G:\proj\defender\zengl\src\zgl_application.pas(71, 31) Error: Incompatible types: got "app_MainLoop;" expected "<procedure variable type of procedure;Register>"
G:\proj\defender\zengl\src\zgl_application.pas(72, 31) Error: Incompatible types: got "zero;" expected "<procedure variable type of procedure;Register>"
G:\proj\defender\zengl\src\zgl_application.pas(73, 31) Error: Incompatible types: got "zero;" expected "<procedure variable type of procedure;Register>"
G:\proj\defender\zengl\src\zgl_application.pas(74, 31) Error: Incompatible types: got "zero;" expected "<procedure variable type of procedure;Register>"
G:\proj\defender\zengl\src\zgl_application.pas(75, 46) Error: Incompatible types: got "zerou(Double);" expected "<procedure variable type of procedure(Double);Register>"
G:\proj\defender\zengl\src\zgl_application.pas(76, 53) Error: Incompatible types: got "zeroa(Boolean);" expected "<procedure variable type of procedure(Boolean);Register>"
G:\proj\defender\zengl\src\zgl_application.pas(96, 1) Fatal: There were 7 errors compiling module, stopping


on these lines:



// call-back
app_PInit : procedure = app_Init;
app_PLoop : procedure = app_MainLoop;
app_PLoad : procedure = zero;
app_PDraw : procedure = zero;
app_PExit : procedure = zero;
app_PUpdate : procedure( dt : Double ) = zerou;
app_PActivate : procedure( activate : Boolean ) = zeroa;


I don't understand this. I have taken the code from the "Initialization" demo. I only moved the zengl source and changed the paths.

Inserting @ sings for all the procedure names after the "=" helps, but then a new error in another file pops up.
I suspect the error is related to using the wrong $MODE. I'm using Lazarus 0.9.30.

Can somebody help me here?

Thanks

chronozphere
25-06-2011, 01:47 PM
I was right. it was the mode! :)

I discovered that you can change this mode for your whole project:

Project -> Project options -> Compiler options -> Parsing (Syntax mode)

Very handy, because I was under the impression that you HAD to use the {$MODE xxx} compiler directive.

Andru
25-06-2011, 04:19 PM
I will try to not forget about MODE directive in next release, but I'm too lazy... :)