我在 XCode 4.4.1 中编写了一些简单的 C++ 程序,每当我编译它们时,都会出现以下错误:
"Main()", referenced from:
mainWrapper() in libStanfordCPPLib.a(startup.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
它是在引用mainWrapper()
inlibStanfordCPPLib.a
吗?提供了后一个文件,是否可以修改内容?否则,我是否需要进行更改以消除对 的引用mainWrapper()
?谢谢。
更多细节:
Ld ./BlankProject.app/Contents/MacOS/BlankProject normal i386
cd "/Users/benjamin/Documents/Programming/iTunes U/Stanford/CS106B Programming Abstractions/Summer 2012/Programs/Section Handout #2 Question 2"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 "-L/Users/benjamin/Documents/Programming/iTunes U/Stanford/CS106B Programming Abstractions/Summer 2012/Programs/Section Handout #2 Question 2" -LStanfordCPPLib "-L/Users/benjamin/Documents/Programming/iTunes U/Stanford/CS106B Programming Abstractions/Summer 2012/Programs/Section Handout #2 Question 2/StanfordCPPLib" "-F/Users/benjamin/Documents/Programming/iTunes U/Stanford/CS106B Programming Abstractions/Summer 2012/Programs/Section Handout #2 Question 2" -filelist "/Users/benjamin/Library/Developer/Xcode/DerivedData/BlankProject-fxnhpjsyinnahlexvnlrhbilvwkd/Build/Intermediates/BlankProject.build/Debug/Section Handout #2 Question 4a.build/Objects-normal/i386/BlankProject.LinkFileList" -framework Cocoa -framework Carbon -framework QuickTime -lStanfordCPPLib -o "/Users/benjamin/Documents/Programming/iTunes U/Stanford/CS106B Programming Abstractions/Summer 2012/Programs/Section Handout #2 Question 2/./BlankProject.app/Contents/MacOS/BlankProject"
Undefined symbols for architecture i386:
"Main()", referenced from:
mainWrapper() in libStanfordCPPLib.a(startup.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)