纠结了一晚上,在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. XCode Could not launch "" failed to get the task for process

    在Xcode下编译project正常,在模拟器下执行正常,最后在真机上执行的时候出现了例如以下错误: Could not launch "FeedMeWorms" failed t ...

  2. iOS:UI系列之UIScrollview和UIPagecontrol

    转眼间,又是一天,就这样忙忙碌碌的一天一天的过着, 不过还好,不是浑浑噩噩的,也算是小有所成,劳有所获吧,嘿嘿! 好了,到了总结的时间啦, 下面就为大家简单讲解下我今天学习的内容吧,希望对各位都有所帮 ...

  3. WEB服务器5--IIS中ISAPI扩展、ISAPI筛选器

    在IIS的文档中经常会提到两个术语:ISAPI扩展和ISAPI筛选器. ISAPI扩展 “ISAPI扩展(ISAPI Extension)”是一种可以添加到IIS中以增强Web服务器功能的程序,其载体 ...

  4. HttpWebRequest上传文件(Excel等)

    //上传代码/// <summary> /// 文件上传 /// </summary> /// <param name="strAddress"> ...

  5. UIView的常用方法

    bringSubviewToFront: 把指定的子视图移动到顶层 - (void)bringSubviewToFront:(UIView *)view 参数 view 需要移到顶层的视图 conve ...

  6. uvA Flooded!

    Description To enable homebuyers to estimate the cost of flood insurance, a real-estate firm provide ...

  7. 实现div中图片的滚动

    今日闲来无事自己写了个图片滚动: 源码: <html><head> <meta charset="utf-8"/> <script typ ...

  8. (原)Eclipse中将JNI生成的so打包成jar的步骤

    说明:新人,对java不熟,见谅. 1. 新建工程,添加好native support,写好对应的文件(包括cpp文件,so文件和对应的java文件,此处称对应的java文件为SoJAR.java,) ...

  9. Mysql表大小数据大小索引大小查询

    SELECT CONCAT(ROUND((INDEX_LENGTH+DATA_LENGTH)/1024/1024, 2), 'MB') AS '总大小',CONCAT(ROUND(DATA_LENGT ...

  10. PLSQL在cmd命令行中的基本用法

    首先:set serveroutput on:设置打印 declareresult number;beginselect (sal*12)+nvl(comm,0) into result from e ...