Forum > macOS / Mac OS X
[SOLVED] Code does not compile on macOS
(1/1)
oh_ha:
Hello,
I have a unit that "A" defines a class "TDirSizeForm" and a standalone procedure "CreateNewDirSizeForm" in its "interface" section.
I have a second unit "B" that "uses" the unit "A" and calls the standalone procedure "CreateNewDirSizeForm" in a method of a class defined in unit "B". This code compiles without errors or warnings on Windows, but fails to compile on MacOS (error "Identifier not found"). The strange thing is that I can create an instance of the class "TDirSizeForm" defined in unit "A" without a problem in the same method of unit "B" in which the call to the procedure "CreateNewDirSizeForm" causes the compiler error.
Any idea why I cannot compile the code on MacOS?
The environment is Lazarus 2.0.10 both on Windows (8.1) and MacOS Catalina. I am using "{$mode objfpc}" in both units.
Thanks for your help, Olaf
[Edited title to add SOLVED]
Soner:
Maybe lowercase or capital letters issue, Windows ist capital insensitive for file names but Macos and unix not.
Write all your unit file names in lowercase letters, also in pascal files like this.
b.pas
--- 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";}};} ---unit b;...end.
a.pas
--- 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";}};} ---unit a;uses b; ...end.
Soner:
Also your volume name looks strange.
/Volumes/$d/Artikel/...
Maybe fpc has problems with this $d part.
I used symbolic links on linux and macos as I developed crossplatform to avoid such problems. Look for 'ln -s' command.
oh_ha:
Renaming all file names and the internal "unit" names did the job: the project now successfully compiles on MacOS -- thanks for the suggestion.
It is just strange that the compiler did resolve the class name, but not the procedure name as they are both declared in the same file.
The path / volume name is due to the fact that the project resides on a Windows PC. If I have any more problems with file names, I'll look into using symbolic links.
Thanks a lot for the speedy replies!
VTwin:
I'm not sure what the issue was. However, unit file names should (generally) be lower case, but can be mixed case in unit names and uses clauses. That should make Windows, Mac, and Linux happy.
Navigation
[0] Message Index