[Solved] El Capitan - Compiled program runs from terminal but not when clicked lazarus / 15-macOS - Mac OS X ---------------------------------------------------------------------- Trenatos · 2016-03-17 22:42 I have a program that compiles and runs on Windows and an old Mac, but on El Capitan after I compile, if I try to double click the binary or the .app, I get a file not found error. BUT, if I run it from terminal from where the .app is, it runs just fine. ---------------------------------------------------------------------- skalogryz · 2016-03-18 04:25 sounds like your bundle (.app) is not-configured. What do you have in yourprogram.app/Contents/MacOS directory? You can try to remove the .app and let Lazarus to rebuild it for you and see if it helps. Sandbox-ed applications are not required in El Capitan, by default. ---------------------------------------------------------------------- Trenatos · 2016-03-18 12:55 Just one file, looks like an Alias to the executable, which is in the same directory as the .app bundle ---------------------------------------------------------------------- Trenatos · 2016-03-18 12:58 I've rebuilt, and get the same .app and executable in the same directory as the .app ---------------------------------------------------------------------- Trenatos · 2016-03-18 13:10 I just found another oddness.. I set the compiler to create new directories per target os, so I have a darwin directory under the project directory. I can run the program from terminal but ONLY if I do so from the project folder, NOT from within the darwin folder. So this works: user$ ./darwin/program Or user$ ./darwin/program.app/Contents/MacOS/program But if I cd into the darwin folder, I get the file not found error. This is, to me, bizarre... --edit I use Lazarus 1.6, FPC 3.0.0 ---------------------------------------------------------------------- skalogryz · 2016-03-18 13:26 do you run it as "program" or "./program" ? How does "file not found" error look like? Is it OS generated or is it something that the program generates on start? ---------------------------------------------------------------------- Trenatos · 2016-03-18 13:57 After some more digging, it looks like it might be a pathing issue in my program. I'll dig at it more and come back with info. ---------------------------------------------------------------------- Trenatos · 2016-03-18 14:15 Definitely my own stupidity and inexperience with developing on a Mac. It was a simple pathing issue to some supporting files, all's well. ---------------------------------------------------------------------- skalogryz · 2016-03-18 17:18 let me ask you this, how did it work on "old Mac"? ---------------------------------------------------------------------- Trenatos · 2016-03-18 20:04 I compiled, it ran. The difference was that this time around I switched folders around, created the .app bundle and whatnot, and then had issues. The problem was entirely behind the keyboard, I eventually figured it out, lol