简体   繁体   中英

Apple Mach-O Linker(id) Error

Im trying to compile a c++ project on xcode.

Im getting this error, and i really have no idea what to do.

searched similar problems , but none helped.

here is the error:

Ld /Users/itzikhanoch/Library/Developer/Xcode/DerivedData/ex4-eepdugqcjenwebctvbtmtbkyguxu/Build/Products/Debug/ex4 normal x86_64
cd /Users/itzikhanoch/Documents/XcodeWorkspace/ex4
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/itzikhanoch/Library/Developer/Xcode/DerivedData/ex4-eepdugqcjenwebctvbtmtbkyguxu/Build/Products/Debug -F/Users/itzikhanoch/Library/Developer/Xcode/DerivedData/ex4-eepdugqcjenwebctvbtmtbkyguxu/Build/Products/Debug -filelist /Users/itzikhanoch/Library/Developer/Xcode/DerivedData/ex4-eepdugqcjenwebctvbtmtbkyguxu/Build/Intermediates/ex4.build/Debug/ex4.build/Objects-normal/x86_64/ex4.LinkFileList -mmacosx-version-min=10.7 -o /Users/itzikhanoch/Library/Developer/Xcode/DerivedData/ex4-eepdugqcjenwebctvbtmtbkyguxu/Build/Products/Debug/ex4

Undefined symbols for architecture x86_64:
"_main", referenced from:
  start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

any idea on what to do?

All C and C++ code must have a global main function where execution starts. The main function must also, according to the specifications, return an integer and have none or two specific arguments:

int main()

int main(int, char **)

int main(int, char *[])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM