Binary installer from sourceforge will not link again libX11 for 64 bit Mac OS programs.
Original Reporter info from Mantis: dieselnutjob
-
Reporter name: Philip
Original Reporter info from Mantis: dieselnutjob
- Reporter name: Philip
Description:
I have tried multiple clean installs of multiple versions of Mac OS and XCode, as well as multiple versions of XQuartz.
In each case when compiling fpGUI apps I encounter
Linking project1
ld: library not found for -lX11
I was careful to specify -Fl/usr/X11/lib or -Fl/opt/X11/lib as appropriate.
I also tried compiling in Lazarus.
I found that compiling 32 bit apps is file, but 64 bit will not work.
Finally I did a clean install and this time installed fpc using fink instead of the sourceforge installer.
Code now works perfectly.
For reference this is the complete working process That I followed using the fink method:-
Clean install Mac OS 10.13.3 from memory stick
https://setapp.com/how-to/how-to-clean-install-macos-high-sierra
Update to 10.13.6
https://apps.apple.com/gb/app/macos-high-sierra/id1246284741?mt=12
Install xquartx-2.7.11
Install xcode 10.1
https://download.developer.apple.com/Developer_Tools/Xcode_10.1/Xcode_10.1.xip
expand xcode.xip
drag to Applications
From terminal:-
xcode-select --install
Fink
Follow this instructions:-
Download and install jdk-8u231-macosx-x64.dmg from Oracle
http://www.finkproject.org/download/srcdist.php
Note that I installed to /opt/sw instead of /sw because /sw won't work in future versions on Mac OS.
Reboot
From terminal:-
fink install fpc
fink install fpc-source
mkdir ~/Programming
cd ~/Programming/
mkdir fpgui-develop
cd fpgui-develop/
git clone https://github.com/graemeg/fpGUI.git
cd fpGUI/src
./build.sh
cd ../examples/apps/docedit/
mkdir units
fpc @extrafpc.cfg docedit.lpr
The installer that causes the problem is this one
https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/3.0.4/fpc-3.0.4a.intel-macosx.dmg/download
One person on the fpGUI support site suggested that it could be related to this report
http://free-pascal-general.1045716.n5.nabble.com/Compile-fpc-64-bit-from-fixes-3-2-td5734465.html
but I have made no effort to look into that.
With the release of Catalina it is now vitally important 64 bit programs can be compiled.
Steps to reproduce:
Clean install of Mac OS (I use High Sierra but the same problem was observed on other versions)
install xquartz
install xcode
install command line tools for xcode
install fpc-3.0.4a.intel-macosx.dmg from sourceforge
install fpgui:-
mkdir ~/Programming
cd ~/Programming/
mkdir fpgui-develop
cd fpgui-develop/
git clone https://github.com/graemeg/fpGUI.git
cd fpGUI/src
./build.sh
compile an fpgui X11 app:-
cd ../examples/apps/docedit/
mkdir units
fpc @extrafpc.cfg docedit.lpr
Additional information:
works for 32 bit X11 apps, fails for 64 bit X11 apps