Discussion:
Error when Updgrading to lastest ( 20/10 ) snapshot...
Dominique Louis
2007-10-20 15:43:00 UTC
Permalink
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the TCarbonPrinter
class is highlighted and the console window error message is :
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"

this include file is definitely missing an implementation section.

Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.

FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.

Dominique.
Hess, Philip J
2007-10-20 16:41:10 UTC
Permalink
Are you trying to use the osprinters unit? Don't do that. Use the Printers and/or PrintersDlgs units or else Lazarus will try to compile osprinters with the non-implemented Carbon printer files.

You'll also probably have to put something like this in "Other Unit Files" path:

$(LazarusDir)/components/printers/lib/$(TargetCPU)-$(TargetOS)/

Now Lazarus can find the compiled units.

Thanks.

-Phil


-----Oorspronkelijk bericht-----
Van: Dominique Louis [mailto:***@savagesoftware.com.au]
Verzonden: za 20-10-2007 10:43
Aan: ***@miraclec.com
Onderwerp: [lazarus] Error when Updgrading to lastest ( 20/10 ) snapshot...

Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the TCarbonPrinter
class is highlighted and the console window error message is :
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"

this include file is definitely missing an implementation section.

Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.

FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.

Dominique.

_________________________________________________________________
To unsubscribe: mail lazarus-***@miraclec.com with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Dominique Louis
2007-10-20 19:11:43 UTC
Permalink
Hi Philip,
Post by Hess, Philip J
Are you trying to use the osprinters unit? Don't do that. Use the Printers and/or PrintersDlgs units or else Lazarus will try to compile osprinters with the non-implemented Carbon printer files.
I'm not specifically trying to to use it. I had a pre-existing project
that worked fine last night with an older snapshot from about 2 weeks
ago. Since I wanted the transparency fix I thought I would upgrade to
the latest snapshop and came across this problem.

I have Printer4Lazarus included in my project file and internally that
references OsPrinters. Even if I remove the refernce to Printer4Lazarus
from the project, it still finds OsPrinters, so this must be being
referenced in some other units as well.

Like I said, this worked flawlessly in the previous snapshot I had and I
have not changed any code since last night. I simply installed the
latest snaphop, opened lazarus and tried to compile the same project
that compiled and ran fine yesterday.
Post by Hess, Philip J
$(LazarusDir)/components/printers/lib/$(TargetCPU)-$(TargetOS)/
Adding this did not solve the problem.


Dominique.
Post by Hess, Philip J
Now Lazarus can find the compiled units.
Thanks.
-Phil
-----Oorspronkelijk bericht-----
Verzonden: za 20-10-2007 10:43
Onderwerp: [lazarus] Error when Updgrading to lastest ( 20/10 ) snapshot...
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Version: 7.5.488 / Virus Database: 269.15.3/1081 - Release Date: 19/10/2007 17:41
Jesus Reyes
2007-10-20 17:42:01 UTC
Permalink
Post by Dominique Louis
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the
TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
The problem should be fixed in svn. The printer carbon specific
implementation is empty though.
Post by Dominique Louis
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
AFAIK, {%Mainunit *} is a hint for the lazarus codetools to find the
unit that includes the current inc file. Should be fixed by now also.
Post by Dominique Louis
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Jesus Reyes A.




____________________________________________________________________________________
¡Sé un mejor fotógrafo!
Perfecciona tu técnica y encuentra las mejores fotos.
http://mx.yahoo.com/promos/mejorfotografo.html
Dominique Louis
2007-10-20 19:17:54 UTC
Permalink
Gracias Jesus,
Do you happen to know at roughly what time the snapshots are done?

Saludos,


Dominique
Post by Jesus Reyes
Post by Dominique Louis
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the
TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
The problem should be fixed in svn. The printer carbon specific
implementation is empty though.
Post by Dominique Louis
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
AFAIK, {%Mainunit *} is a hint for the lazarus codetools to find the
unit that includes the current inc file. Should be fixed by now also.
Post by Dominique Louis
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Jesus Reyes A.
Vincent Snijders
2007-10-20 19:30:33 UTC
Permalink
Post by Dominique Louis
Gracias Jesus,
Do you happen to know at roughly what time the snapshots are done?
Look here to see the times, which match the upload time pretty accurate:
ftp://ftp.hu.freepascal.org/pub/lazarus/

Vincent
Dominique Louis
2007-10-20 19:48:08 UTC
Permalink
Thanks Vincent.
Post by Vincent Snijders
Post by Dominique Louis
Gracias Jesus,
Do you happen to know at roughly what time the snapshots are done?
ftp://ftp.hu.freepascal.org/pub/lazarus/
Vincent
Dominique Louis
2007-10-21 12:41:50 UTC
Permalink
Hi Jesus et al,
I grabbed last night's snapshot and the error still persists.

Can someone please explain why I need Printer4Lazarus in my Mac OS X
project, especially if I am using Printers and PrinterDlg? Also if I
remove the reference to Printer4Lazarus, it still comes up with the same
error. As I mentioned earlier, this implies that the
carbonprinters_h.inc is being reference elsewhere.

Thanks,


Dominique.
Post by Jesus Reyes
Post by Dominique Louis
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the
TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
The problem should be fixed in svn. The printer carbon specific
implementation is empty though.
Post by Dominique Louis
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
AFAIK, {%Mainunit *} is a hint for the lazarus codetools to find the
unit that includes the current inc file. Should be fixed by now also.
Post by Dominique Louis
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Jesus Reyes A.
Hess, Philip J
2007-10-21 14:53:20 UTC
Permalink
Hi Dominique,

I've attached a small project I developed a while back when we were tracking down bugs in the CUPS printer units. Its doesn't need Printer4Lazarus and it compiles fine with the 20071019 snapshot.

Thanks.

-Phil


-----Original Message-----
From: Dominique Louis [mailto:***@savagesoftware.com.au]
Sent: Sun 10/21/2007 7:41 AM
To: ***@miraclec.com
Subject: Re: [lazarus] Error when Updgrading to lastest ( 20/10 ) snapshot...

Hi Jesus et al,
I grabbed last night's snapshot and the error still persists.

Can someone please explain why I need Printer4Lazarus in my Mac OS X
project, especially if I am using Printers and PrinterDlg? Also if I
remove the reference to Printer4Lazarus, it still comes up with the same
error. As I mentioned earlier, this implies that the
carbonprinters_h.inc is being reference elsewhere.

Thanks,


Dominique.
Post by Jesus Reyes
Post by Dominique Louis
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the
TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
The problem should be fixed in svn. The printer carbon specific
implementation is empty though.
Post by Dominique Louis
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
AFAIK, {%Mainunit *} is a hint for the lazarus codetools to find the
unit that includes the current inc file. Should be fixed by now also.
Post by Dominique Louis
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Jesus Reyes A.
_________________________________________________________________
To unsubscribe: mail lazarus-***@miraclec.com with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
Dominique Louis
2007-10-21 15:31:36 UTC
Permalink
Hi Philip,
I have a project that looks like this...

program MyProg;

uses
{$IFDEF UNIX}{$IFDEF Use Cthreads}
cthreads,
{$ENDIF}{$ENDIF}

Interfaces;

begin

end;

As you can see the project is rather empty, but I'm using the 20th and
now the 21st build and when I try to compile it, I still get the
TCarbonPrinter error.

Could it be a lazarus IDE setting? Not sure if this makes any difference
either, I did not delete the previous lazarus install before installing
the newer one.

any ideas?

Dominique.
Post by Hess, Philip J
Hi Dominique,
I've attached a small project I developed a while back when we were tracking down bugs in the CUPS printer units. Its doesn't need Printer4Lazarus and it compiles fine with the 20071019 snapshot.
Thanks.
-Phil
-----Original Message-----
Sent: Sun 10/21/2007 7:41 AM
Subject: Re: [lazarus] Error when Updgrading to lastest ( 20/10 ) snapshot...
Hi Jesus et al,
I grabbed last night's snapshot and the error still persists.
Can someone please explain why I need Printer4Lazarus in my Mac OS X
project, especially if I am using Printers and PrinterDlg? Also if I
remove the reference to Printer4Lazarus, it still comes up with the same
error. As I mentioned earlier, this implies that the
carbonprinters_h.inc is being reference elsewhere.
Thanks,
Dominique.
Post by Jesus Reyes
Post by Dominique Louis
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the
TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
The problem should be fixed in svn. The printer carbon specific
implementation is empty though.
Post by Dominique Louis
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
AFAIK, {%Mainunit *} is a hint for the lazarus codetools to find the
unit that includes the current inc file. Should be fixed by now also.
Post by Dominique Louis
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Jesus Reyes A.
Vincent Snijders
2007-10-21 15:45:52 UTC
Permalink
Post by Dominique Louis
Hi Philip,
I have a project that looks like this...
program MyProg;
uses
{$IFDEF UNIX}{$IFDEF Use Cthreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces;
begin
end;
Not "end." ?
Post by Dominique Louis
As you can see the project is rather empty, but I'm using the 20th and
now the 21st build and when I try to compile it, I still get the
TCarbonPrinter error.
Could it be a lazarus IDE setting? Not sure if this makes any difference
either, I did not delete the previous lazarus install before installing
the newer one.
any ideas?
An idea:
Take a look at the project inspector and check what packages are
"required". For this program only LCL should be enough (no
printers4lazarus).

Vincent
Dominique Louis
2007-10-21 16:01:18 UTC
Permalink
Post by Vincent Snijders
Not "end." ?
Yes it is ment to be end.

As it turns out it was the required package causing that problem, but
removing it causes other Printer related issues, as mentioned in my
other email.


Dominique.
Dominique Louis
2007-10-21 15:59:41 UTC
Permalink
I think I have found what causes the problem.

Everytime you drop a TPrintDialog onto a Lazarus form, it adds
Printer4Lazarus both are a required package and to the Project's uses
clause. This then causes the problem mentioned earlier.

If I then remove the required package and remove the reference from the
project file, it compiles further but now come up with an error of...
"Unit PrintersDlgs searched but Printer found" on a form that has 2
TPrintDialogs.

What does this new error mean?


Dominique.
Post by Hess, Philip J
Hi Dominique,
I've attached a small project I developed a while back when we were tracking down bugs in the CUPS printer units. Its doesn't need Printer4Lazarus and it compiles fine with the 20071019 snapshot.
Thanks.
-Phil
-----Original Message-----
Sent: Sun 10/21/2007 7:41 AM
Subject: Re: [lazarus] Error when Updgrading to lastest ( 20/10 ) snapshot...
Hi Jesus et al,
I grabbed last night's snapshot and the error still persists.
Can someone please explain why I need Printer4Lazarus in my Mac OS X
project, especially if I am using Printers and PrinterDlg? Also if I
remove the reference to Printer4Lazarus, it still comes up with the same
error. As I mentioned earlier, this implies that the
carbonprinters_h.inc is being reference elsewhere.
Thanks,
Dominique.
Post by Jesus Reyes
Post by Dominique Louis
Hi all,
this is possibly a silly error on my part. I have just updated to the
latest snapshot version of Lazarus/FPC. When I try and compile my Mac OS
X project the unit carbonprinters_h.inc is opened and the
TCarbonPrinter
"carbonprinters_h.inc(7,3 Fatal : Syntax Error, 'IMPLEMENTATION'
expected but identifier TCarbonPrinter found"
this include file is definitely missing an implementation section.
The problem should be fixed in svn. The printer carbon specific
implementation is empty though.
Post by Dominique Louis
Btw, what does {%MainUnit ../osprinters.pp} imply? When I looked in that
directory all I found was osprinters.pas not osprinters.pp.
AFAIK, {%Mainunit *} is a hint for the lazarus codetools to find the
unit that includes the current inc file. Should be fixed by now also.
Post by Dominique Louis
FPC compiler is listed as 2.2.1 and the Lazarus editor is listed as
v0.9.23 beta.
Dominique.
Jesus Reyes A.
Version: 7.5.488 / Virus Database: 269.15.3/1082 - Release Date: 20/10/2007 14:59
Vincent Snijders
2007-10-21 17:08:40 UTC
Permalink
Post by Dominique Louis
I think I have found what causes the problem.
Everytime you drop a TPrintDialog onto a Lazarus form, it adds
Printer4Lazarus both are a required package and to the Project's uses
clause. This then causes the problem mentioned earlier.
If I then remove the required package and remove the reference from the
project file, it compiles further but now come up with an error of...
"Unit PrintersDlgs searched but Printer found" on a form that has 2
TPrintDialogs.
You must use printers4lazarus, otherwise you cannot have a printdialog.
PrintDialog is not part of the LCL.

VIncent
Dominique Louis
2007-10-21 18:03:03 UTC
Permalink
Post by Vincent Snijders
You must use printers4lazarus, otherwise you cannot have a printdialog.
PrintDialog is not part of the LCL.
If I add printers4lazarus to the project this then takes me full circle
back to to my original problem and error. If I remove printers4lazarus I
get the PrintDialog error, if I include printers4lazarus I get the
missing implementation error.

So what should I do?

Apologies if I'm sounding frantic, but I'd really like to move ahead on
this, and my client is expecting a new build this week.

Thanks,


Dominique.
Vincent Snijders
2007-10-21 18:11:53 UTC
Permalink
Post by Dominique Louis
Post by Vincent Snijders
You must use printers4lazarus, otherwise you cannot have a printdialog.
PrintDialog is not part of the LCL.
If I add printers4lazarus to the project this then takes me full circle
back to to my original problem and error. If I remove printers4lazarus I
get the PrintDialog error, if I include printers4lazarus I get the
missing implementation error.
So what should I do?
As far as I can see you have three options:
1. Don't use TPrintDialog in your application
2. Don't use carbon widgetset, but gtk widgetset
3. Implement a carbon widgetset backend for printers4lazarus.

Maybe Jesus Reyes just committed a workaround in r12545.

Vincent
Jesus Reyes
2007-10-21 18:14:32 UTC
Permalink
Post by Vincent Snijders
Post by Vincent Snijders
You must use printers4lazarus, otherwise you cannot have a
printdialog.
Post by Vincent Snijders
PrintDialog is not part of the LCL.
If I add printers4lazarus to the project this then takes me full circle
back to to my original problem and error. If I remove
printers4lazarus I
get the PrintDialog error, if I include printers4lazarus I get the
missing implementation error.
So what should I do?
Apologies if I'm sounding frantic, but I'd really like to move
ahead on
this, and my client is expecting a new build this week.
Thanks,
Dominique.
Well the problem is that carbon implementation was empty and just a
squeleton was there, yet this squeleton was buggy :( (copy and paste
problem) and because it wasn't really compiled (I don't have a mac)
it was not inmediately noticed. I made some changes in r12545 and it
should be fixed, please test.

Btw, I changed the default for carbon to use cups implementation as
it was before, the squeleton is still there for somebody to fill
implementation :).

Jesus Reyes A.


____________________________________________________________________________________
¡Sé un mejor asador!
Aprende todo sobre asados.
http://mx.yahoo.com/promos/mejorasador.html
Dominique Louis
2007-10-22 22:33:05 UTC
Permalink
Post by Jesus Reyes
Well the problem is that carbon implementation was empty and just a
squeleton was there, yet this squeleton was buggy :( (copy and paste
problem) and because it wasn't really compiled (I don't have a mac)
it was not inmediately noticed. I made some changes in r12545 and it
should be fixed, please test.
Hi Reyes,
when is r12545 due to be released as a snap shot? If it was last
night, then things still are not working.

Now the compilation gets further and an error now appears in
PrintersDlgs.pp where the Execute methods of 2 classes there do not
exist, so a forward declaration compiler error is thrown.

I tried to work around it by copying PrintersDlgs.pp locally to the
project directory and filling in the missing methods manually, but the
IDE refuses to pick up the local version. It is always picking up the
version found in .../componenets/printers/, which obviously does not
compile.

Thanks,


Dominique.

Jesus Reyes
2007-10-21 19:07:01 UTC
Permalink
Post by Dominique Louis
Hi Jesus et al,
I grabbed last night's snapshot and the error still persists.
Can someone please explain why I need Printer4Lazarus in my Mac OS X
project, especially if I am using Printers and PrinterDlg? Also if I
remove the reference to Printer4Lazarus, it still comes up with the same
error. As I mentioned earlier, this implies that the
carbonprinters_h.inc is being reference elsewhere.
Thanks,
Dominique.
The TPrinter class in LCL printers unit, is not implemented because
lazarus plays with more than windows, so implementation is delegated
to Printer4Lazarus (P4L) package. Using only the lcl printers unit
has the effect of initialize the global object Printer to nil, and
programs that use only printers unit will surely crash.

P4L main unit is OsPrinters which depending on compile target it
creates a instance of TWinPrinter or TCupsPrinter, so Printer is not
nil anymore. TWinPrinter uses windows native api and that's why we
see native dialogs under windows, TCupsPrinter uses the CUPS library
for the same thing, but it doesn't have native dialogs. Carbon
support is planned and so there is a squeleton to fill, the same
could be done for other widgetsets that implement "native".

BTW, Phil's example modify the "other sources" path (compiler option
-Fu) to include the directory where P4L package is located, so it's
pretty much the same than doing a requirement of P4L package, It
works because the program has PrintersDlgs in the uses clause,
PrintersDlgs it's a P4L unit that in turn uses OsPrinters unit which
in the end do the correct intialization.

Jesus Reyes A.


____________________________________________________________________________________
¡Sé un mejor fotógrafo!
Perfecciona tu técnica y encuentra las mejores fotos.
http://mx.yahoo.com/promos/mejorfotografo.html
Loading...