AFraser
AFraser

Reputation: 1006

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

Upvotes: 0

Views: 869

Answers (1)

stefanB
stefanB

Reputation: 79910

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.

Upvotes: 2

Related Questions