X11 library not found on Mountain Lion lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- mdeveau · 2013-08-20 09:51 I have an application that needs to install some packages and rebuild lazarus. It compiles and runs fine under Linux and Win, with Lazarus 1.0.10 On MacOS X, I get: ld: library not found for -lX11 when compiling Lazarus with new packages. I've found libX11 under usr/X11/lib, and add include and lib paths in the project inspector => same error I've installed XQuartz-2.7.2, but same error. I don't have any experience with MacOS X.... Any help is greatly appreciated. ---------------------------------------------------------------------- IndianaJones · 2013-08-20 10:25 Have you installed the latest XCode? In XCode there is an option which I havent remembered now something like 'Unix tools or command line tools' or something like that. This one could be the missing link. Thanks. ---------------------------------------------------------------------- kodok.buncit · 2013-08-20 11:05 what the exact name of the libX on usr/X11/lib? then symlink it Code: [Select]ln -s usr/X11/lib/[actual X11] usr/X11/lib/libX11.so ---------------------------------------------------------------------- Dibo · 2013-08-20 11:30 I don't have experience with Mac but I supose it could be similar like on Linux. On linux you need also header libs. libX11.so is used in runtime. Those libs have -dev suffix. For example on Ubuntu Linux, to get it, I need to do: Quotesudo apt-get install libx11-dev ---------------------------------------------------------------------- BigChimp · 2013-08-20 11:36 Quote from: mdeveau on August 20, 2013, 11:51:03 amI have an application that needs to install some packages and rebuild lazarus. It compiles and runs fine under Linux and Win, with Lazarus 1.0.10 On MacOS X, I get: ld: library not found for -lX11 when compiling Lazarus with new packages. Have you followed this: http://wiki.lazarus.freepascal.org/Installing_Lazarus_on_MacOS_X ??? Also, please specify your OSX version. AFAIR there have been some changes in names etc. ---------------------------------------------------------------------- mdeveau · 2013-08-20 12:33 Thx for helping. Quote from: BigChimp on August 20, 2013, 01:36:34 pmHave you followed this: http://wiki.lazarus.freepascal.org/Installing_Lazarus_on_MacOS_X ??? Lazarus 1.0.10 was already installed, don't know how, but I found that "Command Line Tools" was not installed in XCode 4.6. I installed it. Maybe I should reinstall Lazarus now... I checked that demos codes compile and run fine with the current Lazarus. Quote from: BigChimp on August 20, 2013, 01:36:34 pmAlso, please specify your OSX version. AFAIR there have been some changes in names etc. OSX version is 10.7.5 Lazarus 1.0.10 FPC 2.6.2 Quote from: kodok.buncit on August 20, 2013, 01:05:33 pmwhat the exact name of the libX on usr/X11/lib? then symlink it Code: [Select]ln -s usr/X11/lib/[actual X11] usr/X11/lib/libX11.so I've got libX11.dylib in usr/X11/lib. Tryed to symlink it, but failed (no libX11.so found, and cannot touch it even in sudo...) ---------------------------------------------------------------------- mdeveau · 2013-08-20 13:22 Uninstalling with the shell script then reinstalling from the disk images had no effect. Despite, I managed building Lazarus with some additional package (VirtualTreeView), but one of them leads to the same X11 library missing error (it's our own package, which depends on BGRABitmapPack, LazOpenglContext and LCL). I cannot find where X11 lib is needed in this package. Any idea? - how to re-build Lazarus with X11 lib? - how to remove X11 dependency in package? ---------------------------------------------------------------------- IndianaJones · 2013-08-20 14:20 I'm not so sure but, you can install the port for mac and install the X11 and X11-dev packages, that could be the answer. Thanks.