Forum > macOS / Mac OS X
(Newbie) error in compiling my first macOS sample program
dng8888g:
Just start it and there is a sample program (project1 with form1). Compile and give me a lot of error message:
--- Quote ---Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
This is key I assume out of many; as I write a simple program per this tutorial
https://youtu.be/7qv4zqyG9jw?si=ypG_FW5Dxn7valPa&t=569i.e. the following code:
--- 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";}};} --- program project2; var myname : string; begin Write('Enter your name: '); Readln(myname); Writeln('Hello, ', myname); Readln; end.
--- Quote ---Compile Project, Target: /Users/xxxxxx/Documents/Github/yyyyyyyy/_lazarus_tp_test2/project2: Success, Errors: 1, Warnings: 1
Warning: ld: warning: -multiply_defined is obsolete
Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
The MacOS X to macOS is long time ago. I suspect I might have an easier version and hence at least delete all under ./lazarus and retype the code. Still error. Not sure how to proceed.
Is there some setting I need to change perhaps?
For the moment, I just delete all the ~/.lazarus and even the manual down Lazarus and download again via brew install Lazarus see whether any difference.
carl_caulkett:
--- Quote from: dng8888g on October 12, 2024, 10:24:59 am ---
--- Quote ---Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
--- End quote ---
This particular error is quite harmless, even though it is intensely annoying 😉
I haven't found a way to avoid getting it...
carl_caulkett:
--- Quote from: dng8888g on October 12, 2024, 10:24:59 am ---Just start it and there is a sample program (project1 with form1). Compile and give me a lot of error message:
--- Quote ---Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
This is key I assume out of many; as I write a simple program per this tutorial
https://youtu.be/7qv4zqyG9jw?si=ypG_FW5Dxn7valPa&t=569i.e. the following code:
--- 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";}};} --- program project2; var myname : string; begin Write('Enter your name: '); Readln(myname); Writeln('Hello, ', myname); Readln; end.
--- Quote ---Compile Project, Target: /Users/xxxxxx/Documents/Github/yyyyyyyy/_lazarus_tp_test2/project2: Success, Errors: 1, Warnings: 1
Warning: ld: warning: -multiply_defined is obsolete
Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
The MacOS X to macOS is long time ago. I suspect I might have an easier version and hence at least delete all under ./lazarus and retype the code. Still error. Not sure how to proceed.
Is there some setting I need to change perhaps?
--- End quote ---
I was able to build and run your app...
--- Code: Bash [+][-]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";}};} ---[Sat Oct 12 2024 10:07am (BST+0100)]~/code/fpc/testdng8888g ./project1Enter your name: CarlHello, Carl [Sat Oct 12 2024 10:07am (BST+0100)] took 6s~/code/fpc/testdng8888g
These are the total warnings and "errors"...
--- Code: Text [+][-]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";}};} ---Hint: Start of reading config file /Users/carlcaulkett/.fpc.cfgHint: Start of reading config file /etc/fpc.cfgHint: End of reading config file /etc/fpc.cfgHint: End of reading config file /Users/carlcaulkett/.fpc.cfgVerbose: Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64Debug: Copyright (c) 1993-2021 by Florian Klaempfl and othersVerbose: Target OS: Darwin for x86_64Verbose: Compiling project1.lprVerbose: Assembling project1Verbose: Linking /Users/carlcaulkett/Code/FPC/testdng8888g/project1Warning: ld: warning: -multiply_defined is obsoleteError: -macosx_version_min has been renamed to -macos_version_minVerbose: 13 lines compiled, 0.7 secVerbose: 4 hint(s) issued
As you can see, the so-called error is there, but it didn't stop the smooth running of the program.
If you are getting other errors, then there must be something else wrong with your particular set up.
Can you let us know the version of Lazarus and FPC that you are running?
dbannon:
Just searching through the Lazarus source, the only mention of "macosx_version_min" is in a script used to pre-build the package. It gets passed to the linker. It would seem reasonably certain you are not using that script.
So, the question is, where is that term coming from ?
Ah, here it is -
--- Code: ---fpc-3.2.4/compiler/systems/t_darwin.pas: LinkRes.Add('-macosx_version_min');
--- End code ---
You could could try downloading the FPC source (I'd suggest the 3.2.4 branch), edit that file and compile it with your existing FPC322.
Otherwise, your only hope is that one of the FPC developers buys a Mac and is equally annoyed. One issue might be that we don't know just when Apple changed that identifier, we could end up stopping it working altogether on an older Mac.
Davo
dng8888g:
--- Quote from: carl_caulkett on October 12, 2024, 11:26:04 am ---
--- Quote from: dng8888g on October 12, 2024, 10:24:59 am ---Just start it and there is a sample program (project1 with form1). Compile and give me a lot of error message:
--- Quote ---Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
This is key I assume out of many; as I write a simple program per this tutorial
https://youtu.be/7qv4zqyG9jw?si=ypG_FW5Dxn7valPa&t=569i.e. the following code:
--- 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";}};} --- program project2; var myname : string; begin Write('Enter your name: '); Readln(myname); Writeln('Hello, ', myname); Readln; end.
--- Quote ---Compile Project, Target: /Users/xxxxxx/Documents/Github/yyyyyyyy/_lazarus_tp_test2/project2: Success, Errors: 1, Warnings: 1
Warning: ld: warning: -multiply_defined is obsolete
Error: -macosx_version_min has been renamed to -macos_version_min
--- End quote ---
The MacOS X to macOS is long time ago. I suspect I might have an easier version and hence at least delete all under ./lazarus and retype the code. Still error. Not sure how to proceed.
Is there some setting I need to change perhaps?
--- End quote ---
I was able to build and run your app...
--- Code: Bash [+][-]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";}};} ---[Sat Oct 12 2024 10:07am (BST+0100)]~/code/fpc/testdng8888g ./project1Enter your name: CarlHello, Carl [Sat Oct 12 2024 10:07am (BST+0100)] took 6s~/code/fpc/testdng8888g
These are the total warnings and "errors"...
--- Code: Text [+][-]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";}};} ---Hint: Start of reading config file /Users/carlcaulkett/.fpc.cfgHint: Start of reading config file /etc/fpc.cfgHint: End of reading config file /etc/fpc.cfgHint: End of reading config file /Users/carlcaulkett/.fpc.cfgVerbose: Free Pascal Compiler version 3.2.2 [2021/05/16] for x86_64Debug: Copyright (c) 1993-2021 by Florian Klaempfl and othersVerbose: Target OS: Darwin for x86_64Verbose: Compiling project1.lprVerbose: Assembling project1Verbose: Linking /Users/carlcaulkett/Code/FPC/testdng8888g/project1Warning: ld: warning: -multiply_defined is obsoleteError: -macosx_version_min has been renamed to -macos_version_minVerbose: 13 lines compiled, 0.7 secVerbose: 4 hint(s) issued
As you can see, the so-called error is there, but it didn't stop the smooth running of the program.
If you are getting other errors, then there must be something else wrong with your particular set up.
Can you let us know the version of Lazarus and FPC that you are running?
--- End quote ---
A bit of a surprise. You are right. I can go to the command mode and it run as ./project2!
I do it on windows 11 and it seems to work. Might be this is how macOS work?
Or might be there is some options I missed that prompt the command windows somehow.
Navigation
[0] Message Index
[#] Next page