Recent

Author Topic: Error: Illegal qualifier  (Read 8879 times)

apostleofchrist

  • New Member
  • *
  • Posts: 21
Error: Illegal qualifier
« on: June 02, 2012, 09:35:03 pm »
Greetings everyone!

I'd like to ask to the community for your assistance on an annoying problem.

I"m trying to install this component from http://www.delphiarea.com/products/delphi-components/marquee/.
The problem is that this component has no installer for Lazarus. No problem. I know the drill. I'm stucked, however, when I try to compile the new package. I've being receving this error: C:\lazarus\components\marquee\SimpleHTML.pas(399,17) Error: Illegal qualifier

I've made a extensive research on internet, but I had no success in finding a solution.

This is the part of the code where the compiling error occurs:
Code: [Select]
function TImageCache.Find(const URI: WideString): PPImageCacheItem;
var
  B: Integer;
begin
  B := HashOf(URI) mod IMAGE_CACHE_BUCKET_SIZE;
  Result := @Buckets[B];

  while Result^ <> nil do
  begin
    if (Result^.URI = URI) then <-- The error happens here!
      Exit
    else
      Result := @Result^.Next;
  end;
end; 

Here's the others samples of code to put it on context.

Code: [Select]
  PPImageCacheItem = ^PImageCacheItem;
  PImageCacheItem = ^TImageCacheItem;
  TImageCacheItem = record
    Next: PImageCacheItem;
    Image: TPicture;
    URI: WideString;
  end;

Code: [Select]
  TImageCache = class
  private
    Buckets: array[0..IMAGE_CACHE_BUCKET_SIZE-1] of PImageCacheItem;
    .....................................

Thank you!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12718
  • FPC developer.
Re: Error: Illegal qualifier
« Reply #1 on: June 02, 2012, 10:41:48 pm »
If this is a component of Delphi origin, do you enable Delphi compatibility mode ($Mode delphi or -Sd parameter)?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error: Illegal qualifier
« Reply #2 on: June 03, 2012, 05:54:53 am »
Delphi and Turbo Pascal allow pointer indirection to be dropped in some (or perhaps all?) contexts, in this case the
Code: [Select]
Result^.URIAs in the definition, Result is of type PPImageCacheItem which when expanded becomes ^^TImageCacheItem, so actually it has to be Result^^.URI. Luckily, Free Pascal's Delphi compatibility mode ({$mode delphi} in source or -Sd in command line) accepts this. So as Marco said, please try enabling that.

apostleofchrist

  • New Member
  • *
  • Posts: 21
Re: Error: Illegal qualifier
« Reply #3 on: June 03, 2012, 06:25:09 pm »
Thank you very much guys!   :D

May the Lord bless you all. :)


 

TinyPortal © 2005-2018