==编译安装==
Download ACE-5.6.1.tar.gz from http://download.dre.vanderbilt.edu/
===Linux platform===
1.
export ACE_ROOT=/home/walter/ACE_wrappers
export LD_LIBRARY_PATH=${ACE_ROOT}/ace:${LD_LIBRARY_PATH}
2. create $(ACE_ROOT)/ace/config.h
#define ACE_HAS_STANDARD_CPP_LIBRARY 1
#include "ace/config-linux.h"
3. create $ACE_ROOT/include/makeinclude/platform_macros.GNU
vi $ACE_ROOT/include/makeinclude/platform_macros.GNU
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
4. make
generate $(ACE_ROOT)/ace/libACE.so -> libACE.so.5.6.1
5.
g++ -o helloace helloace.cpp -I$ACE_ROOT -I./ -L$ACE_ROOT/ace -lACE -ldl -lnsl
void foo ( void );
int ACE_TMAIN ( int , ACE_TCHAR * [])
... {
ACE_TRACE(ACE_TEXT ("main"));
ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IHi Mom ")));
foo();
ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IGoodnight ")));
return 0;
}
void foo ( void )
... {
ACE_TRACE (ACE_TEXT ("foo"));
ACE_DEBUG ((LM_INFO, ACE_TEXT ("%IHowdy Pardner ")));
}
===Win32 platform===
新版本的ACE中已经没有VC6的项目文件,取而代之的是VC7/VC8的项目文件
所以先要安装 Visual C++ 2005 Express Edition 和 Microsoft Platform SDK for Windows Server 2003 R2, 如上所述, 建立${ACE_ROOT}/ace/config.h
#define ACE_HAS_STANDARD_CPP_LIBRARY 1
#include "ace/config-win32.h"
用VC2005打开ace_vc8.sln,然后按F7 build solution即可在lib编译生成
lib/*.dll lib/*.lib
如果编译不成功,你的VC2005可能先要做一些配置
1. 增加 Windows Application 的 Application Wizard
编辑AppSettings.htm
C:/Program Files/Microsoft Visual Studio 8/VC/VCWizards/AppWiz/Generic/Application/html/1033/AppSettings.htm
从441 - 444 行屏蔽下列代码
//WIN_APP.disabled = true;
//WIN_APP_LABEL.disabled = true;
//DLL_APP.disabled = true;
//DLL_APP_LABEL.disabled = true;
2.修改设置以包含 Platform SDK 的 include files
在 Tools -> Options -> Projects and Solutions -> VC++ Directories 增加以下目录
--Executable files:
C:Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Bin
Library files:
C:Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Lib
--Include files:
C:Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include
C:Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include/mfc
3.修改配置以加入其他库文件的连接
编辑C:Program Files/Microsoft Visual Studio 8/VC/VCProject/Defaults/corewin_express.vsprops,
把
AdditionalDependencies="kernel32.lib"
改成
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"