纠结了一晚上,在release版本下运行没问题,一到debug就报错,卡在

Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints("SimplePrinterAdapter","default -p 10000");

因为本人新手,只能求助google,百度。结果没能用的上的答案。

没办法,只有去官网求助了,终于找到一篇文档,看到标题就泪伤了,希望就这么悄无声息的。

Why does my application work fine in release mode but crash in debug mode?

http://doc.zeroc.com/pages/viewpage.action?pageId=2523181

原文:

The most common reason is a library mix-up. When you build your application in debug mode (that is, with _DEBUG defined), the compiler uses a debug version of the memory allocation and deallocation functions (see this MSDN page). When using Ice, memory is sometimes allocated by Ice and deallocated by the application (or vice-versa). You cannot allocate memory with the release version and deallocate this memory with the debug version, therefore it is critical that your application and the Ice libraries linked with your application use the same heap allocation functions.

The binary Ice distribution on Windows includes both debug and release libraries: use the import libraries with a d suffix (such as iced.lib and iceutild.lib) to link with the debug DLLs.

也就是说,debug模式下,运行的依赖库为

iced.lib
iceutild.lib

是有后缀的lib。

再啰嗦一句,在release模式下,引用的依赖库就是

ice.lib
iceutil.lib

VS2010+ICE3.5运行官方demo报错----std::bad_alloc的更多相关文章

  1. AS 新安装Android Studio运行项目前报错:Unable to access Android SDK add-on list

    新安装Android Studio运行项目前报错:Unable to access Android SDK add-on list AS启动后,会在默认路径下检测是否有Android SDK,如果没有 ...

  2. Android——eclipse下运行android项目报错 Conversion to Dalvik format failed with error 1解决

    在eclipse中导入android项目,项目正常没有任何错误,但是运行时候会报错,(clean什么的都没用了.....)如图: 百度大神大多说是jdk的问题,解决: 右键项目-Properties如 ...

  3. Window7中Eclipse运行MapReduce程序报错的问题

    按照文档:http://www.micmiu.com/bigdata/hadoop/hadoop2x-eclipse-mapreduce-demo/安装配置好Eclipse后,运行WordCount程 ...

  4. 用java运行Hadoop程序报错:org.apache.hadoop.fs.LocalFileSystem cannot be cast to org.apache.

    用java运行Hadoop例程报错:org.apache.hadoop.fs.LocalFileSystem cannot be cast to org.apache.所写代码如下: package ...

  5. eclipse运行hadoop程序报错:Connection refused: no further information

    eclipse运行hadoop程序报错:Connection refused: no further information log4j:WARN No appenders could be foun ...

  6. Ansible 脚本运行一次后,再次运行时出现报错情况,原因:ansible script 的格式不对,应改成Unix编码

    Ansible 脚本运行一次后,再次运行时出现报错情况,原因:ansible  script 的格式不对,应改成Unix编码 find . -name "*" | xargs do ...

  7. 运行安装mysql 报错 [root@localhost mysql-mult]# ./scripts/mysql_install_db  --defaults-file=conf/3306my.cnf FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_

    运行安装mysql 报错 [root@localhost mysql-mult]# ./scripts/mysql_install_db  --defaults-file=conf/3306my.cn ...

  8. debug运行java程序报错

    debug运行java程序报错 ERROR: transport error 202: connect failed: Connection timed out ERROR: JDWP Transpo ...

  9. yii2框架安装运行init.bat报错php.exe不是内部或外部命令

    在安装yii2框架的时候,遇到一个很纠结的问题.就是当我把安装包下载下来之后,在公司的电脑安装可以正常,当我回家用自己的电脑安装就报错,提示 php.exe 不是内部或外部命令,也不是可运行的程序.这 ...

随机推荐

  1. POJ训练计划2777_Count Color(线段树/成段更新/区间染色)

    解题报告 题意: 对线段染色.询问线段区间的颜色种数. 思路: 本来直接在线段树上染色,lz标记颜色.每次查询的话訪问线段树,求出颜色种数.结果超时了,最坏的情况下,染色能够染到叶子节点. 换成存下区 ...

  2. javascript 获取event对象

    //转载处 http://www.cnblogs.com/funlake/archive/2009/04/07/1431238.html 非常详细 先从一个简单的例子说起,一个简单的button控件如 ...

  3. bootstrap 常用类名

    一. 常用类1.container居中的内容展示2.row  行内容显示3.col 列内容显示, 列必须在row 中xs 宽度小于768 ,sm宽度小于990 大于768 ,md 宽度大于990,小于 ...

  4. IIS7如何显示详细错误信息

    使用Vista或Win7操作系统的用户在不断增加,用Win7旗舰版开发测试程序程序人员也与日俱增,Win7下测试程序时,如果程序出 错,IIS7会提示HTTP Error 500 - Internal ...

  5. 一些不熟悉的SQL脚本--约束条件

    1.根据表名查询主键的SQL语句 SELECT D.COLUMN_NAME AS COLNAME FROM USER_CONS_COLUMNS D, USER_CONSTRAINTS M WHERE ...

  6. 1218.1——OC中的常见关键字及一些基本方法

    OC常见的关键字介绍: @ 看到这个关键字,我们就应该想到,这是Object-C对C语言的扩展,例如@interface XXX. @interface 声明类 @implementation 实现类 ...

  7. 拥有iframe页面的子父类窗口调用JS的方法,并且注意的事项

    一.前言 我页面用的是EasyUI的弹出窗口里面嵌入一个iframe.第一:父窗口打开子窗口是一个新增用户信息的iframe子页面,点击保存后,子窗口iframe则去调用父窗口的function cl ...

  8. C++服务器设计(二):应用层I/O缓冲

    数据完整性讨论 我们已经选择了I/O复用模型作为系统底层I/O模型.但是我们并没有具体解决读写问题,即在我们的Reactor模式中,我们怎么进行读写操作,才能保证对于每个连接的发送或接收的数据是完整的 ...

  9. CF 13E Holes 【块状链表】

    题目描述: 一条直线上n个点,每个点有个“弹力”,可以把当前位置x上面的ball弹到x+a[x]上面. 两种操作 0. 修改a处的弹力值,编程b 1. 询问a点的ball经过多少次能跳出n个点外(就是 ...

  10. javascript跨域获取json数据

    项目在开发过程中,用到了天气预报的功能,所以需要调用天气预报的api,一开始以为直接用ajax调用url就可以获取天气数据,结果涉及到了跨域的问题,这里做一个记录. 说到跨域,就得知道同源策略. 同源 ...