linker command failed with exit code 1

升级到Xcode8之后遇到文件冲突,错误如下:

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

是因为个某个文件中的某一变量或者某一方法名和其他某一文件的变量名或者方法有重复同名,解决方法如下 :在Build Setting里面 NO Common Blocks 设置为NO

官方的解释是:

    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.

猜你喜欢

转载自siruoxian.iteye.com/blog/2374134