该错误信息是我在一个.h文件里申明了公共变量,然后在其他类里重复使用。

Build Settings ->No Common Blocks默认为YES,编译器就报错了,需要修改Build Settings里的No Common Blocks为NO。

NO Common Blocks 是什么?

官方的解释是:

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.

在C语言中,在目标文件的数据段分配甚至未初始化的全局变量,而不是生成它们作为公共块。这样做,如果同一个变量被声明(没有extern)放在两个不同的汇编,你会当你将它们链接得到一个错误的影响。这可能是有用的唯一原因是,如果你想验证程序将在其他系统上,它总是以这种方式工作工作。

iOS duplicate symbol 变量 in 类名 报错的更多相关文章

  1. django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法

    django.db.utils.InternalError: (1060, "Duplicate column name 'user_id'")迁移报错解决方法 django.db ...

  2. vscode 黑屏及类名报错解决方案

    1.安装vscode之后打开黑屏,解决方案如下图,右键--属性--兼容性--勾选上 2.vscode 类名总报错 是ES2017的语法修饰器引起vscode警告. 解除的方法如果你使用的typescr ...

  3. cocos2d-x 头文件中添加方法变量导致编译报错

    代码如下: HelloWorldScene.h #ifndef __HELLOWORLD_SCENE_H__#define __HELLOWORLD_SCENE_H__ #include " ...

  4. axios 异步加载 导致 {{}} 中变量为 undefined 报错 的 解决方案

    情景:axios 异步加载数据,当返回数据为一个 数组 时,双花括号中 这样写 会报错 {{informationDetail[0].img}} 解决方案一:通过 v-if 进行判断 解决方案二:单独 ...

  5. iOS url带中文下载时 报错解决方法

    问题描述:下载文件时, 请求带中文的URL的资源时,比如:http://s237.sznews.com/pic/2010/11/23/e4fa5794926548ac953a8a525a23b6f2/ ...

  6. Java中float浮点型变量不加F报错情况

    1 public class Text { 2 3 public static void main(String args[] ){ 4 float x=123.45; 5 System.out.pr ...

  7. iOS 真机测试的一些报错

    1.连了手机热点 fix Issue后出现提示框:No Devices Registered:Creating a provisioning profile requires one or more ...

  8. iOS在UITableViewController里使用UISearchDisplayController报错"[UISearchResultsTableView dequeueReusableCellWithIdentifier:forIndexPath:]"

    出现如下错误: 2016-02-13 22:09:22.318 Test[2757:192106] *** Assertion failure in -[UISearchResultsTableVie ...

  9. erlang 二进制中 拼接 变量或者函数 报错

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVsAAACiCAIAAABgR/nfAAAM5ElEQVR4nO2dzZrcKBJF9Zjd/tnOdN

随机推荐

  1. apache自带的web监控器配置

    第一:将mod_status模块放开,即去掉httpd.conf中的# 第二:在httpd.conf后面添加下面内容 <Location /server-status> SetHandle ...

  2. Python WebDriver自动化测试

    转载来自: http://www.cnblogs.com/fnng/p/3160606.html Webdriver Selenium 是 ThroughtWorks 一个强大的基于浏览器的开源自动化 ...

  3. Android 应用程序升级到 5.0 需要注意的问题

    Android 5.0,代号 Lollipop,源码终于在2014年12月3日放出,国内一大批厂商跟进.最大的改变是默认使用 ART(Android Runtime) ,替换了之前的 Dalvik 虚 ...

  4. Linux TOP 交互命令

    今天总结一点top命令的一些交互命令,比较实用! h或者?       显示帮助画面,给出一些简短的命令总结说明 k                          终止一个进程. 系统将提示用户输 ...

  5. Javascript函数重载,存在呢—还是存在呢?

    1.What's is 函数重载? );//Here is int 10 print("ten");//Here is string ten } 可以发现在C++中会根据参数的类型 ...

  6. 解决VS+opencv中Debug版本与Release版本lib切换的问题

    Author: Maddock Date: 2015-03-26 09:34:48 问题来源:http://bbs.csdn.net/topics/390733725 PS: 按照上述方法做的时候,在 ...

  7. JupyterNotebook如何添加table of content

    不要总是等待,而是去创造 方法一 ipython notebook升级成了jupyter notebook,在4.x之后的版本,jupyter提供了jupyter-nbextension命令来安装和启 ...

  8. hierarchyid

    hierarchyid: http://www.cnblogs.com/shanyou/archive/2011/07/01/2095968.html RABBITMQ: http://www.rab ...

  9. python 线程之 数据同步 Queue

    Queue:将数据从一个线程发往另外一个线程比较通用的方式是使用queue模块的Queue类 1, 首先创建一个Queue模块的对象,创建Queue对象可以传递maxsize也可以不传递 2. 使用对 ...

  10. Only Link: Inheritance — private and protected inheritance in c++

    reading note link: https://isocpp.org/wiki/faq/private-inheritance