cygwin编译ACE手记

 因为最近要开发一个服务器项目,也打算学习一下ACE,所以就拿Cygwin玩玩ACE,

下载ACE5.5源码包之后,就马上开始编译:

首先参考ACE-Install.htm,其中说到Cygwin下的ACE的编译方法:

  1. Open a Cygwin shell. Set your PATH environment variable so your Cygwin bin directory is first:

           % export PATH=//c/cygwin/bin:$PATH
           

    Note Cygwin uses ``/'' as directory separator, and ``//X'' as a notation for Win32 drive X. Note also that you can't use ``c:/cygwin/bin'' because, for Cygwin, ``:'' is path separator character, as in UNIX.

  2. Add an ACE_ROOT environment variable pointing to the root of your ACE wrappers source tree:
           % export ACE_ROOT=c:/work/cygwin/ACE_wrappers
           

    Note here you can't use the ``//X'' Cygwin notation as this is seen by Cygwin's compiler and it doesn't support that (it does support ``/'' as directory separator however).

    From now on, we will refer to the root directory of the ACE source tree as $ACE_ROOT.

  3. Create a file called config.h in the $ACE_ROOT/ace directory that contains:
           #include "ace/config-cygwin32.h"
           
  4. Create a file called platform_macros.GNU in the $ACE_ROOT/include/makeinclude directory containing:
           include $(ACE_ROOT)/include/makeinclude/platform_cygwin32.GNU
           
    In the above text, don't replace $(ACE_ROOT) with the actual directory, GNU make will take the value from the environment variable you defined previously.
  5. On the Cygwin shell, change to the $ACE_ROOT/ace directory and run make:
           % cd $ACE_ROOT/ace
           % make
           

    This should create libACE.dll (the Win32 shared library) and libACE.dll.a (the Win32 import library for the DLL). Note the name for the ACE DLL on Cygwin follows the UNIX convention.

    If you want static libs also, you may run:

           % make static_libs=1
但是死活编译不成功,make返回Error2,烦死。
google一下,大部分人都是这样编译过了,但是本机就死活不行,
后来终于找到了一个文章,里面说了一种不同于官方文档的编译方法:
先设置ACE_ROOT环境,命令:
“vi /etc/profile”
在其中加入4行
ACE_ROOT=~/ACE_wrappers
export ACE_ROOT
LD_LIBRARY_PATH=$ACE_ROOT/ace:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

我是加在“export PATH USER….”后的。完成后将/etc/profile执行一次,命令:
“chmod 555 /etc/profile”
“/etc/profile”
这样我们的ACE_ROOT就设置好了,可以用如下命令查看ACE_ROOT是否设置好了:
“echo $ACE_ROOT”,
然后执行官方文档的3,4步骤,
最后:
       % cd $ACE_ROOT/ace
       %  make static_libs=1
经过漫长的等待,终于搞定!发文记录一下。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值