C Problem with Compiler?

Posted by Solomon081 on Programmers See other posts from Programmers or by Solomon081
Published on 2012-03-27T01:44:25Z Indexed on 2012/03/27 5:39 UTC
Read the original article Hit count: 370

Filed under:
|

I just started learning C, and wrote my hello world program:

#include <stdio.h>
main()
{
    printf("Hello World");
    return 0;
}

When I run the code, I get a really long error:

Apple Mach-O Linker (id) Error

 Ld /Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Products/Debug/CProj normal x86_64
        cd /Users/Solomon/Desktop/C/CProj
        setenv MACOSX_DEPLOYMENT_TARGET 10.7
        /Developer/usr/bin/clang -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Products/Debug -F/Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Products/Debug -filelist /Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Intermediates/CProj.build/Debug/CProj.build/Objects-normal/x86_64/CProj.LinkFileList -mmacosx-version-min=10.7 -o /Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Products/Debug/CProj

    ld: duplicate symbol _main in /Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Intermediates/CProj.build/Debug/CProj.build/Objects-normal/x86_64/helloworld.o and /Users/Solomon/Library/Developer/Xcode/DerivedData/CProj-cwosspupvengheeaapmkrhxbxjvk/Build/Intermediates/CProj.build/Debug/CProj.build/Objects-normal/x86_64/main.o for architecture x86_64
    Command /Developer/usr/bin/clang failed with exit code 1

I am running xCode

Should I reinstall DevTools?

© Programmers or respective owner

Related posts about c

    Related posts about compiler