Forum > Options
IDE/Project Options ihxutil is called with a leading space in the path, so fails
Cascade:
I’m having difficulty compiling a small project using Lazarus Trunk 4.99 and think I have a glitch my IDE or Project Options.
Compiling itself is OK, but then at the linking stage, ihxutil is called, and fails with:
--- Code: ---Exception at 0000000102147C98: EInOutError:
File not found.
--- End code ---
If I run ihxutil manually from Terminal it completes the linking process successfully. The difference seems to be, Lazarus calls ihxutil with a command line parameter starting:
--- Code: ---" /Users/…etc…
--- End code ---
whereas I execute ihxutil manually with a command line parameter starting:
--- Code: ---"/Users/…etc…
--- End code ---
(notice no leading space character between the starting quote and /Users).
Sounds easy enough to fix, except I’m not sure where the space is coming from. I can’t spot anything in Lazarus Settings or Project Options (but I may well have missed something). I’ve run Find in Files on the entire config_lazarus folder for the string:
--- Code: ---" /
--- End code ---
but nothing is found.
Could a $(macro) add a space when expanded?
n7800:
On the "Project Options > Compiler Options > Compiler Commands" page, are there any commands listed in the "Execute Before" and "Execute After" fields?
By "compiling from the terminal", do you mean "lazbuild", "fpc", or just running the utility itself?
n7800:
--- Quote from: Cascade on March 27, 2026, 09:36:38 pm ---I’ve run Find in Files on the entire config_lazarus folder for the string:
--- Code: ---" /
--- End code ---
but nothing is found.
--- End quote ---
Let's clarify: are you having problems compiling a specific project or the IDE itself? If it's a project, you should search the project files (especially the *.lpi file) rather than the IDE options folder "config_lazarus".
Cascade:
Thanks for the suggestion to search in the project files too. All seems good there (search string " / not found in .lpi file etc.).
Execute Before & Execute After fields are empty.
The Compiler field is a direct path:
--- Code: ---...3.3.1/fpc/bin/aarch64-darwin/fpc.sh
--- End code ---
...because this particular Target requires FPC 3.3.1
I let Lazarus compile first (i.e. Run > Build). Then when linking fails, I open Terminal and re-run just ihxutil manually. That completes the process.
It's a specific project - but my other projects don't use this Target CPU/OS, so maybe they don't call ihxutil (?).
Cascade:
As a quick test I created a new clean empty project with the same Target. The same error occurs at the linking stage.
I think I've found where ihxutil is called by FPC 3.3.1, in the t_zxspectrum.pas file:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function TLinkerZXSpectrum.postprocessexecutable(const fn: string; isdll: boolean): boolean; begin result:=DoExec(FindUtil(utilsprefix+'ihxutil'),' '+fn,true,false); end;
There is a space before the parameter (' '+fn) but that's OK so long as the parameter doesn't get "quoted" later.
Navigation
[0] Message Index
[#] Next page