zoukankan      html  css  js  c++  java
  • ACE在Linux下编译安装

    下载地址: http://download.dre.vanderbilt.edu/


    ACE版本:ACE-6.2.2.tar.bz2


    下载完成后解压路径为:/root/ACE/ACE_wrappers


    设置环境变量

        vi .bashrc,添加的内容为:

    export ACE_ROOT=/root/ACE/ACE_wrappers
    export MPC_ROOT=$ACE_ROOT/MPC
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace:$ACE_ROOT/lib:/usr/local/lib
        保存后执行:

    source .bashrc


    编译ACE:

    1.选择平台配置文件,本系统应该选择config-linux.h,进入$ACE_ROOT/ace,执行命令:

     cp config-linux.h config.h

    2.选择平台宏定义文件,本系统选择platform_linux.GNU,在$ACE_ROOT/include/makeinclude 目录下新建 
    platform_macros.GNU,但是该目录下面有platform_macros.GNU:

    [root@vm makeinclude]# ll platform_macros.GNU
    lrwxrwxrwx 1 root root 36 11-06 12:27 platform_macros.GNU -> ../../apps/gperf/platform_macros.GNU
    然而../../apps/gperf/platform_macros.GNU不存在,即执行下面命令:

    cp /root/ACE/ACE_wrappers/include/makeinclude/platform_linux.GNU /root/ACE/ACE_wrappers/apps/gperf/platform_macros.GNU

    3.进入$(ACE_ROOT)/ace/, 输入编译命令:make -f GNUmakefile, 开始编译libACE.so和libACE.so.6.2.2


    Linux使用ACE编程:

    我写个简单的Hello World!的程序
    1.新建个hello.cpp的文件:

    #include "ace/Log_Msg.h"
    int ACE_TMAIN(int argc, int argv[])
    {
        ACE_DEBUG((LM_DEBUG, ACE_TEXT("Hello World!
    ")));
        return 0;
    }


    2.创建hello.mpc文件:
    project(hello) : aceexe{
    exename = hello
    Source_Files{
    hello.cpp
    }
    Header_Files{
    }
    }


    3.使用MPC实用工具生成Makefile。再创建一个可执行文件hc,可执行文件hc的文件内容为:
    $ACE_ROOT/bin/mpc.pl -type make hello.mpc


    4.运行hc后,产生Makefile.hello后,运行make -f Makefile.hello 生成hello的可执行文件

    5.运行:

    [root@vm ~]# ./hello
    Hello World!

  • 相关阅读:
    在IT行业工作如何获得高薪?选择前沿的技术,把准方向,有技术有人缘
    如何去做不想做的事情的 - 10个建议
    如何去做不想做的事情的 - 10个建议
    项目管理
    项目管理
    Spring Quartz 定时任务
    Spring Quartz 定时任务
    Spring @Transactional (一)
    Spring @Transactional (一)
    Search Insert Position
  • 原文地址:https://www.cnblogs.com/hehehaha/p/6332409.html
Copyright © 2011-2022 走看看