简体   繁体   中英

Starting a project with Stanford C++ Libraries in XCode

I'm trying to follow along with the Stanford CS106B course. 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
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

Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

You have 2 main() functions in the application that you are trying to compile.

One is in task11.o and another one in 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.

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