Xcode Error 254 When Running Linux Executable File

I was trying to build a piece of code and launch the generated linux executable with Xcode. I selected build and run. After code is build I saw that Xcode was showing "Running executable" and after 5seconds it showed finish with "Program ended with exit code: 254" in the output.

What is exit code 254 in xcode? I couldn't find the answer in google.

Answered by abhi_varma in 702437022

Check @OOPer comment

if it was built for Linux run it on Linux.

EDIT: Unix executable developed for MacOS not Linux

When Xcode console shows Program ended with exit code: , the exit code is generated by the app you were running, not by Xcode. What is exit code 254 in your app? Does your app have any parts exit(254) (or possibly, exit(-2))? Google would not answer to the problem specific to your app.

@OOper I understand now. I found exit(-2) in the code when i debugged it showed what the issue was. Executable is working It needs another app to launch first. Thank You

Accepted Answer

Check @OOPer comment

Xcode Error 254 When Running Linux Executable File
 
 
Q