linux下安裝ACE開發環境

來源:互聯網
上載者:User

標籤:macros   虛擬   例子   ftp下載   sig   style   bsp   解決   profile   

安裝環境:虛擬機器-centos 7

ACE源碼:http://download.dre.vanderbilt.edu/       

              我選擇的是ACE+TAO.tar.gz    FTP下載Full源碼,之前下載的Sources only源碼裡面沒有makefile,不知為何~

安裝參考:http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html#unix 

 

一

Install GNU make 3.79.1 略,虛擬機器內建編譯器的。


二

把下載好的安裝包解壓,得到一個ACE_wrappers目錄

修改環境變數 vim /etc/profile 追加
export ACE_ROOT=/home/...your path.../ACE_wrappers
export LD_LIBRARY_PATH=$ACE_ROOT/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
注意要source

 

三

 

建立檔案 $ACE_ROOT/ace/config.h 裡面寫上一行:
#include "ace/config-linux.h"


四

建立檔案 $ACE_ROOT/include/makeinclude/platform_macros.GNU, 裡面寫上兩行
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
INSTALL_PREFIX = /usr/local

 

五

在ACE_ROOT 下 make    ,此處可能遇到幾個問題

1,error while loading shared libraries: libACE
解決辦法
cp -a lib/libACE.so.6.4.0 /usr/lib/libACE.so.6.4.0
cp -a lib/libACE.so.6.4.0 /usr/local/lib/libACE.so.6.4.0
2,/usr/local/ACE_wrappers/apps/gperf/tests/test.cpp:28: undefined reference to
`in_word_set(char const *, unsigned int)‘
collect2: ld returned 1 exit status
make[4]: *** [cppout] Error 1
make[4]: Leaving directory `/usr/local/ACE_wrappers/apps/gperf/tests‘
解決辦法
我直接改了這個test.cpp檔案,修改in_word_set函數(函數名也改了,new_in_word_set),完善定義與調用。


六

make install


七

寫個例子測試一下 建立helloACE.cpp

#include "ace/Log_Msg.h"
int ACE_TMAIN(int argc, char* argv[])
{
ACE_DEBUG((LM_DEBUG, ACE_TEXT("Hello ACE!\n")));
return 0;
}
編譯:g++ -c -I /usr/local/ACE/include helloACE.cpp -o helloACE.o
連結:g++ -L /usr/local/ACE/lib/ -lACE helloACE.o -o helloACE
執行: ./helloACE,輸出:Hello ACE 表示 ACE可用

 

linux下安裝ACE開發環境

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.