#1 2020-05-13 04:54:47

Graham Lovell
Member
Registered: 2020-05-13
Posts: 2

E2197 Constant object cannot be passed as var parameter

When I added SynPDF into my Delphi XE6 application, and after removing the define for USE_SYNZIP, I got this error in the compiler when it got to Application.CreateForm(TfMain, fMain);

  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TfBook, fBook);
  Application.CreateForm(TfMain, fMain);

If I remove SynPDF from the application, it goes away.

I removed the define for USE_SYNZIP because it gave me a compile error on unsatisfied forward declaration for memcpy and 3 other procedures. Removing this define was allowed in the notes to this define.

Offline

#2 2020-05-15 21:38:07

Graham Lovell
Member
Registered: 2020-05-13
Posts: 2

Re: E2197 Constant object cannot be passed as var parameter

The problem I encountered was that my existing form name, fMain, conflicts with a constant in SynPdf {fAddGlyphFont: (fNone, fMain, fFallBack);}.

Removing the conflict allowed the program to compile.

My immediate fix was to change fMain to ffMain in SynPdf and then change the references to this variable as required.

Offline

Board footer

Powered by FluxBB