ACE 6 0 0 編譯安裝使用

2021-05-28 10:51:42 字數 1705 閱讀 5397

win7 vs2010 ace-6.0.0

新增環境變數:path=「%ace_root%\lib」

ace_root\ace目錄下新建config.h檔案,檔案內容:

// config.h

#define ace_has_standard_cpp_library 1 // 用於標準c++跨平台

#include "ace/config-win32.h" // 在win32環境下使用ace

#define ace_use_wchar

#define ace_has_wchar // 支援unicode

開啟ace_root\ace目錄下專案ace_vc解決方案

vs2010開啟ace_vc10.sln

vs2008開啟ace_vc9.sln

vs2005開啟ace_vc8.sln

用vs2010開啟ace_vc10.sln之後,選中其中的乙個專案ace,進入專案-屬性選單,編輯配置屬性-vc++ 目錄

右側的 包含目錄新增$(ace_root),庫目錄新增$(ace_root)\lib,跟原有內容之間以分號隔開。

編譯該專案即可在ace_root\lib下生成所需要的aced.dll和aced.lib檔案(debug版本的為aced.dll aced.lib,release版本的為ace.dll ace.lib)

可以以此對該解決方案下其他專案做同樣設定,編譯生成自己需要的dll和lib。

像普通c++專案一樣,新建好這個專案之後,還是如同第3步,在專案--屬性中,編輯配置屬性-vc++ 目錄

右側的 包含目錄新增$(ace_root),庫目錄新增$(ace_root)\lib,跟原有內容之間以分號隔開。

然後編譯,執行。

// servermain.cpp

// 如果是win32平台上報錯

// 可以檔案頭新增win32的預定**決

#ifndef win32

#define win32

#endif

// 針對debug版和release版進行不同預處理

#ifdef _debug

#pragma comment(lib,"aced.lib")

#else

#pragma comment(lib,"ace.lib")

#endif

#include #include #include #include #include #define size_data 18

#define size_buf 1024

#define no_iterations 5

class server

//handle the connection once it has been established. here the

//connection is handled by reading size_data amount of data from the

//remote and then closing the connection stream down.

int handle_connection()

server server(ace_os::atoi(argv[1]));

server.accept_connections();

return 0;

}

ACE編譯安裝

tar zxf ace 6.1.0.tar.gz 2.設定環境變數 vim bashrc export ace root home yourname export ld library path ld library path ace root ace 3.建立檔案 ace root ace con...

Centos 編譯安裝ACE

這裡只安裝了ace,其他的包沒有涉及。1.tar xvf ace x.x.x.tar.gz 2.設定環境變數 vim bashrc export ace root home yourname export ld library path ld library path ace root ace cd...

Centos編譯安裝ACE

centos編譯安裝ace 這裡只安裝了ace,其他的包沒有涉及。tar xvf ace 6.0.3.tar.gz cd ace wrappers www.2cto.com 針對不同版本建立兩個檔案鏈結 cd ace ln s config linux.h config.h cd include m...