Recent

Author Topic: Cannot Specify Printer4Lazarus in Project Inspector  (Read 1292 times)

Dan3468298

  • Full Member
  • ***
  • Posts: 124
Cannot Specify Printer4Lazarus in Project Inspector
« on: July 05, 2020, 03:16:58 am »
I installed Printer4Lazarus (see first attached image) yet cannot specify it as a Requirement in Project Inspector because the package is listed as Online. I have tried to remove and re-add to no avail.   I am not sure if my Package Manager became corrupt because I could spec the Printer4Lazarus in another project.   
« Last Edit: July 05, 2020, 04:19:00 am by Dan3468298 »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

trev

  • Hero Member
  • *****
  • Posts: 843
  • Former Delphi 1-7 and 10.2 User
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #1 on: July 05, 2020, 04:24:00 am »
As your printer woes seem to be related to your earlier thread, if it was me, I would uninstall Lazarus, delete the .lazarus (dot lazarus) directory in your home directory and then reinstall a fresh copy of Lazarus.
o Lazarus v2.1.0 r63598, FPC v3.3.1 r45778, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (Parallels VM)
o FPC 3.0.4, FreeBSD 12-STABLE r361007 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3809
  • I like bugs.
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #2 on: July 05, 2020, 10:02:16 am »
Is it really listed as online? Maybe it already is a dependency for your project through some other package.
Mostly Lazarus trunk on Manjaro Linux.

Dan3468298

  • Full Member
  • ***
  • Posts: 124
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #3 on: July 05, 2020, 01:25:36 pm »
The screen shots are for a new project with only the default code.   I previously had Lazarus pre-2.0.8 installed on Mac OS but couldn't get it to run because of linking errors so after awhile I did a complete uninstall with the wiki script then installed 2.0.8.  All worked fine until tried Printer4Lazarus.  See attached for new screen shot that explicitly shows Lazarus thinks the Printer4Lazarus is Online though PackageManager lists it as Installed.   After removing Printer4Lazarus it is marked with a Red 'x', why?  (see second screenshot).   Thanks!
« Last Edit: July 05, 2020, 01:48:59 pm by Dan3468298 »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3809
  • I like bugs.
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #4 on: July 05, 2020, 05:53:06 pm »
The screen shots are for a new project with only the default code.   I previously had Lazarus pre-2.0.8 installed on Mac OS but couldn't get it to run because of linking errors so after awhile I did a complete uninstall with the wiki script then installed 2.0.8.  All worked fine until tried Printer4Lazarus.  See attached for new screen shot that explicitly shows Lazarus thinks the Printer4Lazarus is Online though PackageManager lists it as Installed.
There is something wrong in your installation or configuration. Please see my screenshots. Printer4Lazarus shows there as expected. It is not online and I can add it as a new project dependency to one of my test projects. No problems.

Quote
After removing Printer4Lazarus it is marked with a Red 'x', why?  (see second screenshot).   Thanks!
Good question. The packages have many icons to indicate their state and purpose. I don't  remember what the red 'x' means. Somebody else may remember (wp maybe).
Mostly Lazarus trunk on Manjaro Linux.

Dan3468298

  • Full Member
  • ***
  • Posts: 124
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #5 on: July 05, 2020, 06:33:34 pm »
I did an uninstall using the script from Wiki then deleted .Lazarus in home folder and Lazarus folder in Library.   Downloaded files again installing FPC, FPC Source, then Laz.   Ran Laz and with default code tried to add Printer4Lazarus to new project but it is still marked as Online.  How can this be?   Are there other files that have to be removed that are not documented?
« Last Edit: July 06, 2020, 02:01:06 pm by Dan3468298 »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

howardpc

  • Hero Member
  • *****
  • Posts: 3490
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #6 on: July 05, 2020, 08:21:44 pm »
Quote
After removing Printer4Lazarus it is marked with a Red 'x', why?  (see second screenshot).   Thanks!
Good question. The packages have many icons to indicate their state and purpose. I don't  remember what the red 'x' means. Somebody else may remember (wp maybe).
The icon in question is named pkg_package_uninstall.png. The L overlay indicates that it is a Lazarus package (the icons used are all in .../Lazarus/images/packages).

trev

  • Hero Member
  • *****
  • Posts: 843
  • Former Delphi 1-7 and 10.2 User
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #7 on: July 06, 2020, 05:11:37 am »
I can confirm that this appears to be a bug.

Fresh installation of Mojave in a VM with Xcode, Xcode command line tools, Lazarus 2.0.6 and FPC 3.0.4.

Attachment 1 - shows Printer4Lazarus is installed
Attachment 2 - shows Printer4Lazarus as "online" and not installed
Attachment 3 - shows attempt to Install from Project Inspector

Error message when compiling otherwise blank project after adding printer4lazarus to uses clause of project source:

Quote
Compile Project, Target: project1: Exit code 1, Errors: 1
project1.lpr(10,10) Fatal: Cannot find printer4lazarus used by project1. Check if package Printer4Lazarus is in the dependencies of the Project Inspector.

Directory listing of /Library/Lazarus/components/printers/lib/x86_64-darwin/cocoa showing printer4lazarus:

Code: Text  [Select][+][-]
  1. -rw-r--r--  1 root  wheel     546  6 Nov  2019 Printer4Lazarus.compiled
  2. -rw-r--r--  1 root  wheel  265188  5 Nov  2019 cocoaprndelegate.o
  3. -rw-r--r--  1 root  wheel    9920  5 Nov  2019 cocoaprndelegate.ppu
  4. -rw-r--r--  1 root  wheel  201220  5 Nov  2019 osprinters.o
  5. -rw-r--r--  1 root  wheel   30780  5 Nov  2019 osprinters.ppu
  6. -rw-r--r--  1 root  wheel    1776  6 Nov  2019 printer4lazarus.o
  7. -rw-r--r--  1 root  wheel    1456  6 Nov  2019 printer4lazarus.ppu
  8. -rw-r--r--  1 root  wheel   11836  5 Nov  2019 printer4lazstrconst.o
  9. -rw-r--r--  1 root  wheel    8182  5 Nov  2019 printer4lazstrconst.ppu
  10. -rw-r--r--  1 root  wheel    4345  5 Nov  2019 printer4lazstrconst.rsj
  11. -rw-r--r--  1 root  wheel  270012  5 Nov  2019 printersdlgs.o
  12. -rw-r--r--  1 root  wheel   12179  5 Nov  2019 printersdlgs.ppu
  13. -rw-r--r--  1 root  wheel    9505  5 Nov  2019 printersdlgs.res

As the original poster indicated, I cannot add Printer4Lazarus using the Project Inspector.

The workaround was to manually add it to the project.lpi file changing:

Code: XML  [Select][+][-]
  1.    <RequiredPackages Count="1">
  2.       <Item1>
  3.         <PackageName Value="LCL"/>
  4.       </Item1>
  5.    </RequiredPackages>

to:

Code: XML  [Select][+][-]
  1.     <RequiredPackages Count="2">
  2.       <Item1>
  3.         <PackageName Value="Printer4Lazarus"/>
  4.       </Item1>
  5.       <Item2>
  6.         <PackageName Value="LCL"/>
  7.       </Item2>
  8.     </RequiredPackages>

I also tried Lazarus 2.1.0 (trunk r63272) with FPC v3.3.1 (trunk r45525) on Mojave with the same results.
o Lazarus v2.1.0 r63598, FPC v3.3.1 r45778, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (Parallels VM)
o FPC 3.0.4, FreeBSD 12-STABLE r361007 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

Dan3468298

  • Full Member
  • ***
  • Posts: 124
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #8 on: July 06, 2020, 02:13:21 pm »
Thank you Trev.  Your workaround worked for me on Catalina.
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2497
    • havefunsoft.com
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #9 on: July 06, 2020, 04:16:48 pm »
you can also Open the package (through "Installed Packages" dialog) and click "Use"->"Add to project"
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Dan3468298

  • Full Member
  • ***
  • Posts: 124
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #10 on: July 06, 2020, 04:31:04 pm »
Please excuse my ignorance but where do I find the 'Installed Packages' dialog?   This should be under the 'Package' menu?
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2497
    • havefunsoft.com
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #11 on: July 06, 2020, 04:48:05 pm »
Please excuse my ignorance but where do I find the 'Installed Packages' dialog?   This should be under the 'Package' menu?
Sorry, I meant Packages -> "Open Loaded Packages"
It should give you the list of IDE installed packages. When you double click one any of those it will bring up the package dialog.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Dan3468298

  • Full Member
  • ***
  • Posts: 124
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #12 on: July 06, 2020, 11:55:18 pm »
Is this considered a Bug?  If so, who wants to file the report?
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

trev

  • Hero Member
  • *****
  • Posts: 843
  • Former Delphi 1-7 and 10.2 User
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #13 on: July 07, 2020, 05:04:13 am »
Is this considered a Bug?  If so, who wants to file the report?

I would think so. Usually the person who encounters the issue would log an issue in the BugTracker. If you do not wish to do so, I'm happy to do it.

As there is a workaround, you might also wish to mark this thread as [SOLVED] by modifying the post title in the first post.
o Lazarus v2.1.0 r63598, FPC v3.3.1 r45778, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (Parallels VM)
o FPC 3.0.4, FreeBSD 12-STABLE r361007 amd64
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3809
  • I like bugs.
Re: Cannot Specify Printer4Lazarus in Project Inspector
« Reply #14 on: July 07, 2020, 11:25:44 am »
Is this considered a Bug?  If so, who wants to file the report?
It must be specific to MacOS somehow. Can you please verify that it happens only on MacOS. Does widgetset (Carbon / Cocoa) make a difference?
Mostly Lazarus trunk on Manjaro Linux.

 

TinyPortal © 2005-2018