Cannot Specify Printer4Lazarus in Project Inspector lazarus / 9-Editor ---------------------------------------------------------------------- Dan3468298 · 2020-07-05 01:16 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. ---------------------------------------------------------------------- trev · 2020-07-05 02:24 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. ---------------------------------------------------------------------- JuhaManninen · 2020-07-05 08:02 Is it really listed as online? Maybe it already is a dependency for your project through some other package. ---------------------------------------------------------------------- Dan3468298 · 2020-07-05 11:25 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! ---------------------------------------------------------------------- JuhaManninen · 2020-07-05 15:53 Quote from: Dan3468298 on July 05, 2020, 01:25:36 pmThe 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. QuoteAfter 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). ---------------------------------------------------------------------- Dan3468298 · 2020-07-05 16:33 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? ---------------------------------------------------------------------- howardpc · 2020-07-05 18:21 Quote from: JuhaManninen on July 05, 2020, 05:53:06 pmQuoteAfter 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 · 2020-07-06 03:11 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: QuoteCompile 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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i -rw-r--r--  1 root  wheel     546  6 Nov  2019 Printer4Lazarus.compiled-rw-r--r--  1 root  wheel  265188  5 Nov  2019 cocoaprndelegate.o-rw-r--r--  1 root  wheel    9920  5 Nov  2019 cocoaprndelegate.ppu-rw-r--r--  1 root  wheel  201220  5 Nov  2019 osprinters.o-rw-r--r--  1 root  wheel   30780  5 Nov  2019 osprinters.ppu-rw-r--r--  1 root  wheel    1776  6 Nov  2019 printer4lazarus.o-rw-r--r--  1 root  wheel    1456  6 Nov  2019 printer4lazarus.ppu-rw-r--r--  1 root  wheel   11836  5 Nov  2019 printer4lazstrconst.o-rw-r--r--  1 root  wheel    8182  5 Nov  2019 printer4lazstrconst.ppu-rw-r--r--  1 root  wheel    4345  5 Nov  2019 printer4lazstrconst.rsj-rw-r--r--  1 root  wheel  270012  5 Nov  2019 printersdlgs.o-rw-r--r--  1 root  wheel   12179  5 Nov  2019 printersdlgs.ppu-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][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                            to: Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                                                 I also tried Lazarus 2.1.0 (trunk r63272) with FPC v3.3.1 (trunk r45525) on Mojave with the same results. ---------------------------------------------------------------------- Dan3468298 · 2020-07-06 12:13 Thank you Trev.  Your workaround worked for me on Catalina. ---------------------------------------------------------------------- skalogryz · 2020-07-06 14:16 you can also Open the package (through "Installed Packages" dialog) and click "Use"->"Add to project" ---------------------------------------------------------------------- Dan3468298 · 2020-07-06 14:31 Please excuse my ignorance but where do I find the 'Installed Packages' dialog?   This should be under the 'Package' menu? ---------------------------------------------------------------------- skalogryz · 2020-07-06 14:48 Quote from: Dan3468298 on July 06, 2020, 04:31:04 pmPlease 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. ---------------------------------------------------------------------- Dan3468298 · 2020-07-06 21:55 Is this considered a Bug?  If so, who wants to file the report? ---------------------------------------------------------------------- trev · 2020-07-07 03:04 Quote from: Dan3468298 on July 06, 2020, 11:55:18 pmIs 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. ---------------------------------------------------------------------- JuhaManninen · 2020-07-07 09:25 Quote from: Dan3468298 on July 06, 2020, 11:55:18 pmIs 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? ---------------------------------------------------------------------- Dan3468298 · 2020-07-07 15:02 Quote from: JuhaManninen on July 07, 2020, 11:25:44 amQuote from: Dan3468298 on July 06, 2020, 11:55:18 pmIs 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? I only have access to MacOS Catalina so Carbon will not run on my machine. ---------------------------------------------------------------------- trev · 2020-07-08 10:33 I can confirm that the issue does not occur with FreebSD 12.1, FPC 3.3.1 snapshot from June 2019 and Lazarus 2.0.6 or 2.1.0 (trunk) using the GTK2 widget set. [EDIT] Lazarus v2.1.0 r61574 with GTK2 widget set, FPC v3.0.4, Ubuntu 18.04 is also OK. [/EDIT] ---------------------------------------------------------------------- JuhaManninen · 2020-07-11 07:53 Yes I believe it is a bug as many people can reproduce it in MacOS. I wonder what makes it OS or Widgetset dependent. I don't have a Mac and cannot test myself. Please report in bug tracker with all details. ---------------------------------------------------------------------- trev · 2020-07-11 08:34 Verified it did not happen with Lazarus compiled with 32 bit Carbon, but does happen with Lazarus compiled with 64 bit Cocoa (tested on macOS 10.11.6). Bug lodged: https://bugs.freepascal.org/view.php?id=37330 ---------------------------------------------------------------------- Dan3468298 · 2020-07-11 12:13 Trev, thank you for your good work! ---------------------------------------------------------------------- JuhaManninen · 2020-07-12 08:05 This is fixed now. It was a clear error of memory access caused by wrong typecasts. It was not specific to OS or Widgetset but it caused more trouble in some systems as memory bugs often do. It is good for code to be tested in many systems. More bugs are revealed. ---------------------------------------------------------------------- trev · 2020-07-12 08:43 Thanks Juha!