PascalTZ [Solved] lazarus / 31-LCL ---------------------------------------------------------------------- MoCityMM · 2020-02-26 15:00 Using: CentOS 8.1.1911 x64 Getting the following error during install using 'Online Package Manager': Compile package PascalTZ 2.1.1: Exit code 1, Errors: 1, Warnings: 1 Warning: windres: can't open file `images\pascaltz.png': No such file or directory pascaltzreg.pas(19,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates. MingW64 package(s) are installed (had to enable 'power tools' option on epel to see them). x86_64-w64-mingw32-windres is installed in 'usr/bin' folder and link is also there 'windres'. Followed instruction(s) from the following: https://wiki.freepascal.org/Lazarus_Resources#Linux Went back and installed the MingW32 package(s) since it was mentioned in the instructions (instructions are out of date? i386-w64-mingw32-windres does not exist). Produced error message mentioned above. Edited the 'fpc.cfg', changed reference from ' i386-w64-mingw32-windres' to 'i686-w64-mingw32-windres' (this file exists). Still same issue. Downloaded package from 'Online Package Manager', opened it, the file is in PascalTZ/package/images folder. Is this a bug or a compiler reference missing, etc? Anyone have a fix? Regards, -Mo ---------------------------------------------------------------------- marcov · 2020-02-26 15:07 QuoteWarning: windres: can't open file `images\pascaltz.png' Note the backslash in the path that windres returns. I think the problem is the backslash in that pat, not windres itself. ---------------------------------------------------------------------- MoCityMM · 2020-02-26 15:16 marcov, Thanks for the reply. Yes, the reference '\' is present in the 'pascaltzreg.rc' file. Are you suggesting modifying the package? I've not done that before (simple process/complicated?). Regards, -Mo ---------------------------------------------------------------------- marcov · 2020-02-26 15:18 .rc is user source. But maybe this case is not very defined. Just try to replace the \ with / in the .rc ---------------------------------------------------------------------- MoCityMM · 2020-02-26 15:34 marcov, Same out come if I understood and followed what you suggested correctly. Then I attempted the following: Tried to recreate the package from source and modified the '.rc' file to reference '/' and it compiled, got a different type of error message(dumped directly into code from the 'PascalTZReg.pas' file): procedure Register; begin   RegisterComponents('Misc', [TPascalTZ]); end; So at this point I am beyond my skill set to do anymore with it. Shame only had this piece to work on in my code, guess I will look for something different option. ---------------------------------------------------------------------- MoCityMM · 2020-02-26 16:30 Ok... think I got it working. Used the following steps to fix it: 1: Opened 'Online Package Manager' 2: Used 'Local Repo' 3: Modified 'pascaltzreg.rc' file to reference '/' 4: Opened package in IDE under 'Package>Open Package File', and under 'Options' changed the 'Compiler>Paths to 'lib/$(TargetCPU)-$(TargetOS)' from 'lib\$(TargetCPU)-$(TargetOS)' 5: Save 6: Compile 7: Install Seems to work. Thanks for the lead on the issue marcov. Regards, -Mo ---------------------------------------------------------------------- wp · 2020-02-26 17:37 I sent a pull request to the author with an idea how to solve the issue without windres (use .res resource instead of .rc). ---------------------------------------------------------------------- dezlov · 2020-03-07 18:41 Quote from: wp on February 26, 2020, 06:37:15 pmI sent a pull request to the author with an idea how to solve the issue without windres (use .res resource instead of .rc). Thanks. It is merged now. ---------------------------------------------------------------------- MoCityMM · 2020-03-15 15:45 Just a FYI, I don't know when the repository gets updated so this maybe inapplicable to the quote below. Quote from: dezlov on March 07, 2020, 07:41:51 pmThanks. It is merged now. But the following is what I had to do to get it working on another box: Steps 4 (minus changing Paths '/' was already there) and Steps 6 - 7. Regards, -Mo ---------------------------------------------------------------------- dezlov · 2020-03-17 22:23 Regarding the step 4: QuoteOpened package in IDE under 'Package>Open Package File', and under 'Options' changed the 'Compiler>Paths to 'lib/$(TargetCPU)-$(TargetOS)' from 'lib\$(TargetCPU)-$(TargetOS)' I wonder why was this necessary? Doesn't Lazarus and FPC automatically adjust path delimiters to match the current platform? The package LPK file contains several PathDelim entries, plus OtherUnitFiles and UnitOutputDirectory entries with Windows style path delimiters. Lazarus even prevents using the Linux style path delimiter in OtherUnitFiles entry, automatically replacing it with the Windows style delimiter. Snippet from the LPK file: 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                                                                   ---------------------------------------------------------------------- dezlov · 2020-03-17 23:41 QuoteOpened package in IDE under 'Package>Open Package File', and under 'Options' changed the 'Compiler>Paths to 'lib/$(TargetCPU)-$(TargetOS)' from 'lib\$(TargetCPU)-$(TargetOS)' Just tried installing the latest PascalTZ into Lazarus 2.0.6 on Linux Mint and it worked just fine, without having to change any paths in 'Compiler>Paths' section of the package. ---------------------------------------------------------------------- wp · 2020-03-17 23:59 I think the problem is that MoCityMM installs the package from OPM, and this is outdated. I added a note to my pull request recently which you maybe did not see. ---------------------------------------------------------------------- MoCityMM · 2020-03-18 14:03 Quote from: MoCityMM on March 15, 2020, 04:45:04 pmBut the following is what I had to do to get it working on another box: Steps 4 (minus changing Paths '/' was already there) and Steps 6 - 7. dezlov, My message indicated that the pathing statement is correct, didn't need to change a thing on that. Thank you for looking into it though. -Mo wp, Thank you for pointing out that the OPM maybe out of date. -Mo ---------------------------------------------------------------------- dezlov · 2020-03-18 19:44 Ok, thanks for confirming. So the only real issue was with inappropriate path delimiters in the RC file, which was resolved by wp's commit: https://github.com/dezlov/PascalTZ/commit/2029be6cab7ce7a5570436923092 2253a5911d7f It's a pity that Lazarus/FPC don't automatically adjust paths in the RC file the same way as with project paths. Anyhow, I'll push a new version shortly.