How to fix this recurring character error?

From the error I get:

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 cannot understand why this error occurs. I just changed some of the framework files in my project and now this error will not go away! Obviously, he says that _main is duplicated, but I don’t know where, or why?

What causes this?

+4
source share
3 answers

You need to look at the main.m / .h and fmdb.m / .h files. Most likely, they both import what _main defines, possibly globally. Usually this is what generates this error for me.

+8
source

There are two main functions in your code. Do a global search of main and delete the one you don't want.

This happens when you add other project files to the project without removing the main function.

+4
source

It looks like you have a few entries under Goals / Compiled Sources. Check and delete them.

+3
source

Source: https://habr.com/ru/post/1395533/


All Articles