1.環境html
CentOS-6.5-x86_64-bin-DVD1.isolinux
VMware_workstation_full_12.5.2 (2).exevim
ACE-6.4.2.tar.gzbash
下載連接:http://download.dre.vanderbilt.edu/app
2.解壓測試
tar zxvf ACE-6.4.2.tar.gz網站
以後會出現一個名字爲ACE_wrappers的文件夾ui
這樣全部ACE的源文件都在/home/用戶名/Software/ACE_wrappers裏面spa
3.配置編譯環境變量.net
#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!\n")));
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