Recent

Author Topic: Identifier not found "__front_type__"  (Read 16872 times)

Lloydie-T

  • New member
  • *
  • Posts: 9
Identifier not found "__front_type__"
« on: January 08, 2009, 02:32:05 am »
I am getting the following error when I try to compile my code. Please help

lnet\lib\lcontainersh.inc(17,31) Error: Identifier not found "__front_type__"

Code: [Select]
{ This include is a little a-la-templates hack

  here are all the "default" type defines which you need to
  redefine yourself after including this file. You only redefine those
  which are used ofcourse }

{$ifndef __front_type__}
  {$ERROR Undefined type for quasi-template!}
{$endif}

const
  MAX_FRONT_ITEMS = 10;

type
  TLFront = class // it's a queue ladies and gents
   protected
    FEmptyItem: __front_type__;
    FItems: array[0..MAX_FRONT_ITEMS-1] of __front_type__;
    FTop, FBottom: Integer;
    FCount: Integer;
    function GetEmpty: Boolean;
   public
    constructor Create(const DefaultItem: __front_type__);
    function First: __front_type__;
    function Remove: __front_type__;
    function Insert(const Value: __front_type__): Boolean;
    procedure Clear;
    property Count: Integer read FCount;
    property Empty: Boolean read GetEmpty;
  end;

My code is causing the problem is below:
Code: [Select]
  if smtpQuery.RecordCount > 0 Then Begin
  smtpName := smtpQuery.FieldByName('smtp_auth_name').AsString = 'Yes';
  smtpPass := smtpQuery.FieldByName('smtp_pass').AsString = 'Yes';
  smtpHost := smtpQuery.FieldByName('server').AsString = 'Yes';
  smtpTo := smtpQuery.FieldByName('email').AsString = 'Yes';
  smtpFrom := 'alerts@helpdex.net';
  smtpSubject := ''Test Message';

  SMTP := TLSMTPClient.Create(Self);
    if smtpQuery.FieldByName('smtp_auth').AsInteger > 0 then Begin
     if SMTP.HasFeature('AUTH LOGIN') then // use login if possible
        SMTP.AuthLogin(smtpName, smtpPass)
      else if SMTP.HasFeature('AUTH PLAIN') then // fall back to plain if possible
        SMTP.AuthPlain(smtpName, smtpPass);
    end;
  smtpQuery.Close;

  message := 'A test Message';

      if (not SMTP.Connected) then begin
      SMTP.Connect(smtpHost, 25);
      end;

      try
      SMTP.SendMail(smtpFrom, smtpTo, smtpSubject, message);
      except
      end;
    end;

Bart

  • Hero Member
  • *****
  • Posts: 5677
    • Bart en Mariska's Webstek
Re: Identifier not found "__front_type__"
« Reply #1 on: January 09, 2009, 10:46:24 am »
I guess you have to replace __front_type__ with the type that you want to use or make a type definition like:
Code: [Select]
type __front_type__ = TMySpeciallyDefinedTypeForThisPrettyQueue;
Bart

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: Identifier not found "__front_type__"
« Reply #2 on: January 09, 2009, 10:57:18 am »
Um.. this is odd.

__front_type__ is used as an internal macro in lNet to produce "template-like" behavior for my queue ("a queue of xxx"). It shouldn't cause any problems. The macro should be defined inside the units and propagated (C style macroes need to be turned on, but it should be via a directive).

Lloydie-T

  • New member
  • *
  • Posts: 9
Re: Identifier not found "__front_type__"
« Reply #3 on: January 11, 2009, 03:11:49 pm »
Thanks for the info. Unfortunately I am not sure what you mean. It only seems to occur when I add the 'lsmtp' unit. In any case I need a bit more of a practical guide to resolve the problem.

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: Identifier not found "__front_type__"
« Reply #4 on: January 12, 2009, 11:53:50 pm »
Please send me the project (which errors out) to almindor [at] gmail [dot] com

Also send info of your FPC version. I'll try to reproduce.

Lloydie-T

  • New member
  • *
  • Posts: 9
Re: Identifier not found "__front_type__"
« Reply #5 on: January 13, 2009, 02:49:33 pm »
On it's way

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: Identifier not found "__front_type__"
« Reply #6 on: January 16, 2009, 10:41:45 am »
Thanks, received. I'll look at it ASAP but I'm in the middle of my finals atm so a bit preoccupied. If I don't reply in some days, feel free to e-mail me a reminder.

Lloydie-T

  • New member
  • *
  • Posts: 9
Re: Identifier not found "__front_type__"
« Reply #7 on: February 03, 2009, 01:49:59 pm »
Bump! Any  news?

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: Identifier not found "__front_type__"
« Reply #8 on: February 13, 2009, 10:49:33 am »
Hey, sorry I looked at it once but it requires zeos which gave me some trouble so I gave up initially. I have zeos set up in windows so I'll test there, hopefully tomorrow. Sorry for the delay, I'm kind of busy lately.

cov

  • Sr. Member
  • ****
  • Posts: 250
Re: Identifier not found "__front_type__"
« Reply #9 on: March 11, 2009, 06:56:35 pm »
I'm getting the same problem.

I tried to install lnetvisual.lpk but it fails at the same point as Lloydie-T.

Just to say:

v0.9.27 r18951 i386-win32-win32/win64
« Last Edit: March 11, 2009, 09:53:20 pm by cov »

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: Identifier not found "__front_type__"
« Reply #10 on: March 15, 2009, 11:39:05 am »
The problem with his example project was it used some odd DB unit which contained uncompilable code (and depended on zeos).

I install lNet 0.6.3 on windows almost weekly (with latest lazarus/trunk and fpc 2.2.2).

If you get it on lnet package compile/install please give me specific version of everything else you use (FPC and lNet)

cov

  • Sr. Member
  • ****
  • Posts: 250
Re: Identifier not found "__front_type__"
« Reply #11 on: March 16, 2009, 08:14:02 am »
Hi Almindor.

Thanks for taking the time...

I'm using Free Pascal Compiler version 2.2.5 [2009/03/11] for i386 on Windows XP (Home)

lNet version 0.6.2 29.05.2008.

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: Identifier not found "__front_type__"
« Reply #12 on: March 18, 2009, 03:29:28 pm »
Can you also please tell me what other 3rd party packages you have installed? I'll try and test this soon.

cov

  • Sr. Member
  • ****
  • Posts: 250
Re: Identifier not found "__front_type__"
« Reply #13 on: March 18, 2009, 05:31:58 pm »
3rd party packages?

Do you mean Lazarus? None, I think:It's a clean install.

cov

  • Sr. Member
  • ****
  • Posts: 250
Re: Identifier not found "__front_type__"
« Reply #14 on: March 19, 2009, 02:29:22 pm »
Almindor,

I have downloaded fpc 2.2.2, installed it and recompiled Lazarus.

Initially I was still getting the same error, but I removed all the installed packages, compiled lNet again and it works!

I take it you are the boffin as regards to using lNet?

I want to hack up a small ssh terminal to access a linux box and I might need help.

Thanks anyway!

Cheers,

Dave Coventry
:)

 

TinyPortal © 2005-2018