繁体   English   中英

Apple Mach-O链接器(id)错误

[英]Apple Mach-O Linker(id) Error

我试图在xcode上编译一个c ++项目。

我得到这个错误,我真的不知道该怎么做。

搜索了类似的问题,但都没有帮助。

这是错误:

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)

什么做的任何想法?

所有C和C ++代码必须具有执行开始的全局main函数。 根据规范, main函数还必须返回一个整数,并且没有或两个特定的参数:

int main()

int main(int, char **)

int main(int, char *[])

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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