简体   繁体   English

在XCode中使用Stanford C ++库启动项目

[英]Starting a project with Stanford C++ Libraries in XCode

I'm trying to follow along with the Stanford CS106B course. 我正在尝试跟随斯坦福CS106B课程。 They provide some libraries for use in the course but I can't for the life of me start and new project, import the libraries and get it to compile. 他们提供了一些在课程中使用的库,但我不能为我的生活开始和新项目,导入库并让它进行编译。

These are the errors im getting. 这些是我得到的错误。 Not sure how helpful they are... 不确定他们是多么有用......

ld: duplicate symbol _main in /Users/adam/Library/Developer/Xcode/DerivedData/Chapter_2-d ld:/ Users / adam / Library / Developer / Xcode / DerivedData / Chapter_2-d中的重复符号_main
hgxptnyygirinbntlelnegvower/Build/Intermediates/Chapter 2.build/Debug/Chapter 2.build/Objects-normal/i386/task11.o and /Users/adam/Library/Developer/Xcode/DerivedData/Chapter_2-dhgxptnyygirinbntlelnegvower/Build/Intermediates/Chapter 2.build/Debug/Chapter 2.build/Objects-normal/i386/main.o for architecture i386 hgxptnyygirinbntlelnegvower / Build / Intermediates / Chapter 2.build/Debug/Chapter 2.build/Objects-normal/i386/task11.o,/ Users / adam / Library / Developer / Xcode / DerivedData / Chapter_2-dhgxptnyygirinbntlelnegvower / Build / Intermediates / Chapter 2.build/Debug/Chapter 2.build/Objects-normal/i386/main.o for architecture i386

Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1 命令/Developer/usr/bin/llvm-g++-4.2失败,退出代码为1

You have 2 main() functions in the application that you are trying to compile. 您正在尝试编译的应用程序中有2个main()函数。

One is in task11.o and another one in main.o . 一个在task11.o ,另一个在main.o Your application can have only one main function so remove one - not sure what exactly you are doing and which one is redundant. 您的应用程序只能有一个主要功能,因此请删除一个 - 不确定您正在做什么以及哪个是多余的。

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

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