linker command failed with exit code 1

After upgrading to Xcode8, I encountered a file conflict and the error is as follows:

error: linker command failed with  exit  code 1 (use -v to see invocation)

是因为个某个文件中的某一变量或者某一方法名和其他某一文件的变量名或者方法有重复同名,解决方法如下 :In Build Setting, NO Common Blocks is set to NO

 

The official explanation is:

    In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error when you link them. The only reason this might be useful is if you wish to verify that the program will work on other systems which always work this way.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326243952&siteId=291194637