4

From the error I am getting:

ld: duplicate symbol _main in /Users/wostler/Library/Developer/Xcode/DerivedData/UIPageViewControllerDemo-hjsgatcuhsxeokdnubifybpivzum/Build/Intermediates/UIPageViewControllerDemo.build/Debug-iphonesimulator/UIPageViewControllerDemo.build/Objects-normal/i386/fmdb.o and /Users/wostler/Library/Developer/Xcode/DerivedData/UIPageViewControllerDemo-hjsgatcuhsxeokdnubifybpivzum/Build/Intermediates/UIPageViewControllerDemo.build/Debug-iphonesimulator/UIPageViewControllerDemo.build/Objects-normal/i386/main.o for architecture i386

I can't figure out why this error is occurring. I simply changed some framework files in my project and now this error won't go away! It obviously says _main is being duplicated, but I dont know where, or why?

What is causing this?

Westley
  • 1,143
  • 14
  • 27

3 Answers3

8

You need to look at the main.m/.h and fmdb.m/.h files. What is most likely is that they are both importing something that defines _main, perhaps at a global level. Usually thats the sort of thing that generates this error for me.

drekka
  • 20,957
  • 14
  • 79
  • 135
4

You have two main function in your code. Do a global search for main and remove the one you don't want.

It happens when you add some other project's files to your project without remove the main function.

Bryan Chen
  • 45,816
  • 18
  • 112
  • 143
3

Sounds like you have multiple entries under Targets/Compiled Sources. Check and remove them.

fannheyward
  • 18,599
  • 12
  • 71
  • 109