Recent

Author Topic: Installing additional package spoiled the previously working code (GLScene)  (Read 1978 times)

Ronan

  • Full Member
  • ***
  • Posts: 132

Dear All,
After installing additional package to the previously working program which uses GLScene library. The program stoppped working and produces the following compile error.

Quote
\....\GLScene\Source\Base\BaseClasses.pas(222,66) Error: Wrong number of parameters specified for call to "NotifyChange"

Corresponding code snippet is that:
Code: Pascal  [Select][+][-]
  1. constructor TNotifyCollection.Create(AOwner: TPersistent; AItemClass: TCollectionItemClass);
  2. begin
  3.   inherited Create(AOwner, AItemClass);
  4.   if Assigned(AOwner) and (AOwner is TGLUpdateAbleComponent) then
  5.     OnNotifyChange := TGLUpdateAbleComponent(AOwner).NotifyChange;
  6. end;
  7.  

From Project Settings-> Parsing Tab, I tried each parsing option individually, which didn't work, Tried to unistall and reinstall the whole package which also didn't help as well.

I couldn't think of any other solution for that , I 'll appreciate the community guidance on that .

Regards,

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4709
  • I like bugs.
How did you install the package? You installed it to Lazarus IDE, or added a package dependency for your program, or just added a unit reference to uses section?
Unit references in uses sections are read sequentially and the last one takes effect in case the same identifier is defined in many units.
Sometimes you may need to reorder a uses section or prepend an identifier with "unitname.".
« Last Edit: January 14, 2017, 11:05:06 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Ronan

  • Full Member
  • ***
  • Posts: 132
I installed it to Lazarus IDE ( GLScene is set of visual components )it is visible in the package tree view, but for each individual program in order to be able to run it, I have to provide package dependencies, unit references in uses section I don't know whether it is correct or not to provide all of it, but at least this is how it works on my side and based on your post I deduce that I'm double referencing something.

I also noticed that changing parsing to Delphi mode yields :
Quote
..\...\GLScene\Source\GLNGDManager.pas(345,25) Error: Fields cannot appear after a method or property definition, start a new visibility section first.
Which is something totally different, but IMHO Delphi mode is the way to go.

Corresponding code portion which raises the ields cannot appear after a method or property definition, start a new visibility section first:
Code: Pascal  [Select][+][-]
  1. class procedure NewtonCollisionIterator(const userData: Pointer;
  2.       vertexCount: Integer; const faceArray: PNGDFloat;
  3.       faceId: Integer); static; cdecl;    
  4.  
Regars,
« Last Edit: January 14, 2017, 11:13:19 am by Ronan »

 

TinyPortal © 2005-2018