纠结了一晚上,在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. vim 快捷键大全

    一.移动光标 1.左移h.右移l.下移j.上移k 2.向下翻页ctrl + f,向上翻页ctrl + b 3.向下翻半页ctrl + d,向上翻半页ctrl + u 4.移动到行尾$,移动到行首0(数 ...

  2. 继承之后的使用注意事项_ArrayStoreException

    今天在看Core In Java第五章节时,看到一个很感兴趣的知识点,如下: 在Java中,子类数组的引用可以转换成超类数组的引用,而不需要采用强制转换.但是,在超类数组的引用添加超类类型引用对象之后 ...

  3. RadioButton 和 RadioButtonList 比较

    第一次接触RadioBttonList时候,觉得这个控件完全可以取代RadioButton,操作更加简便.直到今天,完成了一个小小的功能,才发现,尺有所短不是瞎掰的. 需求如下: Add Prorat ...

  4. jquery模仿css3延迟效果

    HTML <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta ...

  5. 写个点击input框 下方弹出月份时间等

    <input type="text" name="test" id="test" value="" "& ...

  6. POJ 2455 Secret Milking Machine (二分 + 最大流)

    题目大意: 给出一张无向图,找出T条从1..N的路径,互不重复,求走过的所有边中的最大值最小是多少. 算法讨论: 首先最大值最小就提醒我们用二分,每次二分一个最大值,然后重新构图,把那些边权符合要求的 ...

  7. PHP APC缓存配置、使用详解

    一.APC缓存简介 APC,全称是Alternative PHP Cache,官方翻译叫”可选PHP缓存”.它为我们提供了缓存和优化PHP的中间代码的框架. APC的缓存分两部分:系统缓存和用户数据缓 ...

  8. MySQL学习笔记(2) - 修改MySQL提示符的两种方法

    学习于慕课网 http://www.imooc.com/video/1806 1.方法一: cmd中处于未登录状态时,输入 mysql -uroot -p自己的密码 --prompt 新的提示符 示例 ...

  9. opencv + numpy for python

    OpenCV的全称是:Open Source Computer Vision Library.OpenCV是一个基于(开源)发行的跨平台计算机视觉库,可以运行在Linux.Windows和Mac OS ...

  10. SQL Sever 各版本下载 SQL Server 2012下载SQL Server 2008下载SQL Server 2005

    SQL Server 2012SQL Server 2012 开发版(DVD)(X64,X86)(中文简体)ed2k://|file|cn_sql_server_2012_developer_edit ...