Apple Mach-O Linker error while Running a Simple C Program

Hi Guys, I am not a Developer but a student and I dont know I am in right place to ask this question. I am new to forum and Xcode. I am learning C language through Xcode but I always get this error in Xcode.

  • Apple Mach-O Linker Error
  • Linker command failed with exit code 1
  • I dont know what was happening and by mistake I deleted the "x86_64" option from valid Architecture row in Build Settings. And now whenver I run C program from Xcode, it quits unexpectedly and I have to open it again. Please help me with that.

    I dont know if I am asking this question in the right place or right way so please Help me with that too



    Accepted Answer

    The simplest solution in this case might be to start with a new Xcode project, and add copies of your existing source code files to the new project. When you have the new project working, you can discard the old one.


    Backing out of the changes you made to the current project's settings can be a bit awkward, because you can't be sure you know exactly what you changed.

    Thanks, And I also found Solution to that error. I was writing the code in other file rather than main file and compiler was getting confused without the header file.

    Apple Mach-O Linker error while Running a Simple C Program
     
     
    Q