ACE研读笔记之一-编译安装篇

==编译安装==

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

#include  " ace/Log_Msg.h "
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"

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值