linux下编译安装ACE-6.4.2(adpative communication environment)

1.环境

CentOS-6.5-x86_64-bin-DVD1.iso


VMware_workstation_full_12.5.2 (2).exe

ACE-6.4.2.tar.gz

下载链接:http://download.dre.vanderbilt.edu/

2.解压

 tar zxvf ACE-6.4.2.tar.gz

之后会出现一个名字为ACE_wrappers的文件夹

这样所有ACE的源文件都在/home/用户名/Software/ACE_wrappers里面

3.配置编译环境变量

#vim /etc/profile,然后增加如下内容

ACE_ROOT = /home/bigbear/ACE_wrappers
export ACE_ROOT
export LD_LIBRARY_PATH =/usr/local/lib:$ACE_ROOT/lib:$LD_LIBRARY_PATH

使环境变量立即生效source ./etc/profile

4.添加配置文件

在$ACE_ROOT/ace目录中输入vi config.h创建config.h文件,写入:

#include "ace/config-linux.h"

然后保存。

在$ACE_ROOT/include/makeinclude目录中创建一个名为platform_macros.GNU的文件,写入:
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

然后保存

 

  

5.make

6.配置安装输出目录

环境变量添加

INSTALL_PREFIX=/usr/local
export INSTALL_PREFIX


使立即生效

7.make install

如果报错

The variable INSTALL_PREFIX must be set to install.


If binaries are already built and you wantto use RPATH,


they must be rebuilt after changingINSTALL_PREFIX.

上面6步骤没有做好

8.测试

创建helloworld.cpp,写入以下内容:


#include "ace/Log_Msg.h"


int ACE_TMAIN(int argc, char* argv[])


{


ACE_DEBUG((LM_DEBUG, ACE_TEXT("Hello World bigbear! ")));


return 0;


}

输入#g++ helloworld.cpp -o hello -l ACE
再输入# ./hello

 9.参考

   《ACE-6.1.0 linux 下的编译与安装步骤》http://www.cnblogs.com/liangxiaxu/archive/2013/03/07/2948417.html

   官方网站写的编译方法:http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html#unix  

   《ACE在Linux 和 Windows 下ACE的编译》http://blog.csdn.net/zklth/article/details/7190927

原文地址:https://www.cnblogs.com/bigbear1385/p/6594198.html