[SOLVED] lazarus truncation of 8 letters for unit ppu files error lazarus / 21-General ---------------------------------------------------------------------- Pep · 2023-10-15 14:51 I am struggling to build a project with code that is behind the latest Lazarus version. The latest error I got was regarding the ExtractFileNameWithoutExt function or something like that, and I found out in the git history that the function has been moved to LazFileUtils. So I added that to the using list and am now getting and error which the tooltip expands to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i lazarus truncation of 8 letters for unit ppu files may lead to problems when the unit name is longer than 8 letters huh? If Lazarus has a 8 letter limit on unit names why would a unit be created with names longer than 8 letters? I feel like I'm missing something here but have no idea what because with all the languages I have used in my years, including Pascal and Modula-2, this fpc/lazarus combination is baffling me as I have zero experience with it. So what do I do to solve this unit name truncation problem? [EDIT] Well that was weird. Turns out the actual error was that I wrote FileUtils when in fact it should have been FileUtil I'm struggling with a language I don't yet understand, so it would be nice if the compiler said something like QuoteUnknown unit FileUtilsOr something similar, ya know, something helpful ---------------------------------------------------------------------- TRon · 2023-10-15 15:40 Hi Pep, Assuming you use Lazarus for compilation, there is a window/tab (some people have it embedded at the bottom) with compiler messages. That message window usually show these kind of errors. Note that the output for these messages can be filtered (press the right mouse button in that message window to see the different options) so in case you have them ignored/filtered out then they will not show up in the window. see also: https://wiki.freepascal.org/IDE_Window:_Messages ---------------------------------------------------------------------- Pep · 2023-10-15 17:16 Hi Tron, I have that window open at the bottom, and that's the error I was shown. Other errors shown in that window take me to the error when I click on them but that one did nothing, I had to stumble my way through to a solution, which is why I found the whole thing strange. ---------------------------------------------------------------------- wp · 2023-10-15 17:36 Quote from: Pep on October 15, 2023, 04:51:37 pmTurns out the actual error was that I wrote FileUtils when in fact it should have been FileUtil I'm struggling with a language I don't yet understand, so it would be nice if the compiler said something like QuoteUnknown unit FileUtilsOr something similar, ya know, something helpful  When I add "FileUtils" (plural, instead of singular) to the uses clauses of the empty default Lazarus project and try to compile, I get "Fatal: Unit FileUtils searched but FileUtil found", but nothing with an 8-character truncation. I am afraid that there is something else which is not correct on your side. Searching the entire code base of Laz/main, Laz 3.0RC1, Laz 2.2.6, 2.0.12 and 1.8.4 for the text "8 letters" I did not find any hit. What was the Lazarus/FPC version that you were using when you saw that hint about the 8 letters? ---------------------------------------------------------------------- jamie · 2023-10-15 20:19 @WP   There is a funky bug with the compiler that I have commented about before, and just recently again.  If you have a unit name of 8 chars or more and the first 8 matches an existing unit you have in the list, and you have a secondary unit in your project that has that same name with additional characters in the name, you will get that error.  I posted an example the other day.  Included the "printers" unit in your uses list, create a new unit for you project and name it "printersx" and try to compile the program.  At least for me, it fails with that message on old fpc and 3.2.2/ ---------------------------------------------------------------------- wp · 2023-10-15 23:21 Sorry, cannot confirm, the attached project compiles and runs correctly (Win 11, Laz/main FPC3.2.2 32+64bit, Laz/main FPC/main 32.bit).