Unable to copy SDL2.framework into /Library/Frameworks directory lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- gfuggetta · 2021-09-05 12:52 Dear Lazarus team, I am very new in the use MacOs (I have started using Big Sur three days ago). I have the Lazarus source code of my software which currently compiles for Windows and Linux. To compile my software for MacOs I would need to copy the following four frameworks into the System frameworks folder. Library/Frameworks/SDL2.framework Library/Frameworks/SDL2_mixer.framework Library/Frameworks/SDL2_ttf.framework Library/Frameworks/SDL2_image.framework So,I downloaded the four corresponding versions of .dmg MacOS installer files. When I opened them, I found the four directories listed above (e.g. SDL_image.framework, etc..). Unfortunately, when I tried to copy one by one the the four "framework" to the place where all other SDL frameworks are stored (/Library/Frameworks directory), the access was denied.  Consequently, the Lazzaus Mac Os compiler is writing this message: Error: Id:framework not found SDL2. I am the only user on this machine, so I should have the rights as administrator. Is there an alternative simple way I should use to be able to copy these four frameworks to the framework directory perhaps using the terminal (e.g. sudo, etc...)? Please note: I am a beginner in using Mac Os. So it would be nice if you could write in simple words the procedure to solve the issue. Many thanks Best wishes Giorgio ---------------------------------------------------------------------- madref · 2021-09-06 06:04 How did you install them in Windows and Linux... Should be the same way ---------------------------------------------------------------------- trev · 2021-09-06 06:46 Any app-specific frameworks should be included in your app bundle. ie. project1.app/Contents/Frameworks/SDL2.framework and then use the command line utility install_name_tool thus: Code: [Select]cd project1.app/Contents/MacOS install_name_tool -add_rpath "@executable_path/../Frameworks/." project1 Full details in the Wiki at macOS Dynamic Libraries. ---------------------------------------------------------------------- gfuggetta · 2021-09-06 10:07 Thank you very much, I will try what you have written. Giorgio ---------------------------------------------------------------------- trev · 2021-09-08 04:26 Quote from: gfuggetta on September 05, 2021, 02:52:05 pmTo compile my software for MacOs I would need to copy the following four frameworks into the System frameworks folder. Library/Frameworks/SDL2.framework Library/Frameworks/SDL2_mixer.framework Library/Frameworks/SDL2_ttf.framework Library/Frameworks/SDL2_image.framework Unfortunately, when I tried to copy one by one the the four "framework" to the place where all other SDL frameworks are stored (/Library/Frameworks directory), the access was denied. OK, to compile the application you need to either copy the SDL2 frameworks to /Library/Frameworks or tell the linker where to find them. To copy them to /Library/Frameworks you will need to open am Applications > Utilities > Terminal, change to the directory in which the frameworks are located and copy them to the destination using eg:  sudo rsync -rv SDL2* /Library/Frameworks Alternatively, to tell the linker where to find them, in the Lazarus IDE go to Project > Project Options > Compiler Options > Compilation and Linking and there you will have to check the option "Pass options to linker with -k, delimiter is space" and enter the following:  -F/path/to/SDL2_frameworks (The trick here is NOT to enter -k at all as Lazarus does this automatically). Of course you will probably also need the {$linkframework whatever} directive(s) in your Pascal unit(s). When it comes to distributing your application, you will need to include the frameworks as previously indicated in the application bundle.