1、编译ace-6.0.2win32在$ace_root$ace下面增加config.h文件,添加内容如下
#pragma once
//#define ACE_USES_WCHAR //使用unicode字符集#define ACE_HAS_MFC 1 //是否使用mfc#include "ace/config-win32.h"打开对应的项目/工程文件,编译
在default_constants.h中修改# if !defined (ACE_DEFAULT_ASYNCH_BACKLOG)# define ACE_DEFAULT_ASYNCH_BACKLOG SOMAXCONN/*5更改最大*/# endif /* ACE_DEFAULT_ASYNCH_BACKLOG */linux#tar -jxf ACE-xxx.tar.bz2加环境变量export ACE_ROOT=/home/lsl/ACE_wrappersexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace到用户的profile文件#cd /home/userxxx/ACE_wrapper#mkdir build#cd build#../configure --enable-ssl=no --enable-gperf=no --enable-static=yes --cache-file=linux.cache--enable-ssl表示openssl支持--enable-gperf表示gperf库支持--enable-static表示编译静态库,默认只编译动态库,考虑开发使用可能会用到静态版本--cache-file表示配置脚本输出的结果文件,中断后继续执行配置脚本时可节省时间
configure过程中如果出现event poll测试失败,执行echo "ace_cv_linux_event_poll=true" > linux.cache
然后继续configure
最后#make && make install2、使用(1)编写使用了ACE的代码(2)编写MakefileBIN = hello_aceFILES = Piece2 Piece3SRC= $(addsuffix .cpp,$(FILES))OBJ= $(addsuffix .o,$(FILES))BUILD = $(VBIN)#---------------------------------------------------------# Include macros and targets#---------------------------------------------------------include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNUinclude $(ACE_ROOT)/include/makeinclude/macros.GNUinclude $(ACE_ROOT)/include/makeinclude/rules.common.GNUinclude $(ACE_ROOT)/include/makeinclude/rules.nonested.GNUinclude $(ACE_ROOT)/include/makeinclude/rules.bin.GNUinclude $(ACE_ROOT)/include/makeinclude/rules.local.GNU
以上的Makefile包含3个cpp文件hello_ace.cpp、Piece2.cpp和Piece3.cpp
(3)编译 #makewin7, ace-6.0.2, vs2008sp1,vs2010
设置如下:
Set the DE> SSL_ROOT DE> environment variable to the location of the directory containing the OpenSSL DE> inc32 DE> and DE> out32dll DE> directories. Add DE> ssl=1 DE> to your MPC DE> $ACE_ROOT/bin/MakeProjectCreator/config/default.features DE> or DE> $ACE_ROOT/local.features DE> file, and re-run MPC to add support for building the ACE_SSL library to your MSVC++ workspaces and projects. Open the DE> ACE.sln DE> solution, and refer to the ACE build and installation instructions above for details on creating a DE> config.h DE> configuration header for this platform. On ce the DE> config.h DE> file has been created, build the DE> ACE_SSL DE> project.
ACE和MFC配合,或者使用mpc生成工程
在Windows下安装Perl环境,然后重启。然后执行下面命令 cd