ICE开发环境搭建 全

8 篇文章 0 订阅
ICE作为一种无平台的中间件,提供了最灵活的编译方式,即自定义的平台无关语言slice,这种以语言方式来配置的做法,极大的统一了网络服务的标准,有点类似于java语言的实现与编译,正是因为java语言的定义与实现都是由SUN公司提供的,才极大的推动了java语言的发发展。
在linux平台下编译比windows平台简单的多,必须要用g++ 3.x来编译ICE的开发包,否则会报错。

在http://www.zeroc.com/download.html 中下载Ice-3.0.1.tar.gz和ThirdParty-Sources-3.0.1.tar.gz,

先编译ThirdParty-Sources-3.0.1.tar.gz:
1、mkdir ThirdParty
2、cp ThirdParty-Sources-3.0.1.tar.gz ThirdParty
3、tar –xzvf ThirdParty-Sources-3.0.1.tar.gz
4、tar –xzvf openssl-0.9.8a.tar.gz
5、cd openssl-0.9.8a
6、./ Configure;make;make install
7、cd ..
8、tar –xzvf expat-1.95.8.tar.gz
9、cd expat-1.95.8
10、./ configure;make;make install
11、cd ..
12、tar –xzvf db-4.3.29.NC.tar.gz
13、cd db-4.3.29.NC
14、cd build_unix
15、../dist/configure;make;make install
16、cd ../..
17、tar –xzvf Ice-3.0.1.tar.gz
18、cd Ice-3.0.1
19、将config文件夹下的Make.rules.Linux,将c++改为g++
20、将config文件夹下的Make.rules里面的变量修改为第三方库的路径,找?号的是系统已经安装的,在linux下STL就是STLport不用另行安装。
#STLPORT_HOME ?= /opt/STLport


#
# If libbzip2 is not installed in a standard location where the compiler
# can find it, set BZIP2_HOME to the bzip2 installation directory.
#

#BZIP2_HOME ?= /opt/bzip2


#
# If Berkeley DB is not installed in a standard location where the
# compiler can find it, set DB_HOME to the Berkeley DB installation
# directory.
#

#DB_HOME = /root2/opt/db

#
# If OpenSSL is not installed in a standard location where the
# compiler can find it, set OPENSSL_HOME to the OpenSSL installation
# directory.
#

OPENSSL_HOME = /root2/opt/openssl

#
# Define if your OpenSSL requires Kerberos, and if Kerberos is not
# installed in a standard location.
#

KERBEROS_HOME ?= /usr/kerberos

#
# If expat is not installed in a standard location where the
# compiler can find it, set EXPAT_HOME to the expat
# installation directory.
#

EXPAT_HOME = /root2/opt/expat


#
# If readline is not installed in a standard location where the
# compiler can find it, AND you want to use readline,
# set READLINE_HOME to the readline installation directory.
#
#

#READLINE_HOME ?= /opt/readline

这一步如果出了问题 参见我转载的另一篇博客 《ICE在Linux下的完整编译安装》

21、make;make install

这样ICE就可以编译过去了,可以用make test来测试编译得是否正确。

在windows平台上安装ICE比较简单,就是VC设置麻烦些。因为我用的是VC6.0,但用VC7.0和8.0都有相对应的包,安装步骤是一样的。
首先从http://www.zeroc.com/download.html下载ThirdParty-3.0.1-VC60.msi和Ice-3.0.1-VC60.msi,直接安装。
打开VC6.0,在include和lib设置时,在include中加入Ice-3.0.1-ThirdParty-VC60\include\stl_port和Ice-3.0.1-VC60\include。同理在lib中加入Ice-3.0.1-ThirdParty-VC60\lib和Ice-3.0.1-VC60\lib
将Ice-3.0.1-ThirdParty-VC60\include和Ice-3.0.1-ThirdParty-VC60\lib放在第一行,否则编译STL的时候还是没有用STL_port,就会编译失败。
在编译console类型的程序时,要将Porject->setting->c/c++->code gereration中的Use run-time library中的Debug Multithreaded DLL选上,实现多线程,因为ICE本身天生就是多线程的。
在任何情况下编译ICE程序,都要将Porject->setting->C++ Language中的Enable Run-Time Type Information (RTTI)选中,否则STL_port会报Access violation - no RTTI data In Visual Studio (Visual C++)错误。
这样,两种平台上的ICE都安装完毕,可以用Demo来测试环境。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ICE-3.7.4 最新安装文件msi文件,windows版 ICE常见报错 Exception in thread Ice.ConnectionRefusedException error = 0 at IceInternal.Network.doFinishConnect(Network.java:417) at IceInternal.TcpTransceiver.initialize(TcpTransceiver.java:33) at Ice.ConnectionI.initialize(ConnectionI.java:1536) at Ice.ConnectionI.socketReady(ConnectionI.java:1116) at Ice.ConnectionI$SocketReadyCallback.socketReady(ConnectionI.java:2299) at IceInternal.SelectorThread.run(SelectorThread.java:203) at IceInternal.SelectorThread$HelperThread.run(SelectorThread.java:273) Caused by: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574) at IceInternal.Network.doFinishConnect(Network.java:393) ... 6 more 这种报错是ICE服务端没有起来,telnet服务端ICE的端口不通,无法建立socke 原帖地址:http://blog.csdn.net/zhenjing/archive/2009/09/10/4538705.aspx ICE常见编译和运行(异常)错误 收藏 在编译和Ice应用相关的文件中,经常因为ice相关的文件包含关系而导致编译无法通过,此时的错误一般提示和handle.h相关。然而想要解决这样的错误,一般只需要把在无法编译成.o文件的.cpp文件中和ice文件相关的头文件放在该.cpp文件的起始行即可。也就是说,根据提示,把.cpp文件中最早提示导致出错的.h文件放在起始行。 ICE的常见运行错误(异常): 1 使用的地址错误,IP并非本地IP: 发生在初始化服务器时,没办法初始化adapter. 错误信息: (IP错误) ./test: Network.cpp:475: Ice::SocketException: socket exception: Cannot assign requestedaddress 另外: 已经启动服务器后又重新启动: 发生在初始化服务器时,没办法初始化adapter. 错误信息: (port已经被使用) ./server: Network.cpp:475:Ice::SocketException: socket exception: Address already in use ///stringtoProxy对于任何string都是有效的,均可以生成相应代理,但是该代理是否有效是无法保证的. 如果代理无效,也就是说根本就没有这样的adapter或者对象,那么使用Checkcast或直接用该代理调用相应对象接口均会抛异常. 下面对每种情况加于分析. 2 使用的代理IP错误: 发生在使用代理调用接口的时候 原因: 根本就没有相应的通讯器存在. 错误信息: (使用的代理IP错误) 抛出异常: Ice::ConnectFailedException(需要几秒, 需要进行搜索) 3 使用的代理端口错误,两边不一致 : 发生在使用代理调用接口的时候 原因: 存在通讯器,但是不存在相应的对象适配器. 错误信息: 抛出异常: Ice::ConnectionRefusedException(很快, 端口没有被启用引起的,无人监听该端口) 4 使用的对象名字不正确: 发生在使用代理调用接口的时候 原因: 能够找到相应的对象适配器,但是该对象适配器中无法找到相应的对象 错误信息: 抛出异常: Ice::ObjectNotExistException(很
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值