稳定盈利的期货交易方法-量化趋势交易

alantop -专业量化投资者

爱好:量化投资,逆向工程,渗透
随笔 - 595, 文章 - 0, 评论 - 921, 引用 - 0
数据加载中……

ACE 5.6版本的编译

最近,写一些网络程序。下了 最新版本的ACE发现。新的版本已经不支持vc6了。只支持vc7.1和vc8。
看样子现在都在全面过渡vc2005这个编译器。

5.6的ACE编译非常的简单,从网站下载压缩包,然后解压到目录
在目录下的ACE目录下建立一个config.h文件,然后里面包含:
#include "ace/config-win32.h"

然后 编译下debug和release。
现在,备份下ace\config.h文件和lib目录下生成的文件。

下次 不用再编译了,只需要在使用的时候包含头文件和设置相应的库就好了。

下面是翻译了部分的ace资料:

Building and Installing ACE and Its Auxiliary Libraries and Services
生成和安装ACE和它的补充库和服务
Synopsis
概要
The file explains how to build and install ACE, its Network Services, test suite and examples on the various OS platforms and compilers that it has been ported to. Please consult the NEWS and ChangeLog files to see whether any recent changes to the release will affect your code. In addition, you should check out our development process. As you start working with ACE, we suggest you get copies of the C++NPv1, C++NPv2, and APG books to help guide you after you've built and installed ACE. You should also consult the ACE Frequently Made Mistakes page. If you encounter any problems or would like to request an enhancement, then use our bug tracking system to submit a report in accordance with our bug report process.
这个文件解释如何生成和安装ACE,和它的网络服务,测试套件和样例在已经移植到的,不同的操作系统平台和编译器上。请查阅NEWS和ChangeLog文件看最近发布的新版本的改动是否会影响你的代码。另外,你将核实我们的开发进程。作为你开始在ACE上工作,我建议你先看看C++NPv1, C++NPv2, and APG这三本书。你应该查阅下ACE频繁会犯的错误。如果你遇到什么问题或者想有所提高,可以看看我们BUG系统提交的报告。

Document Index
Platforms, C++ Compilers, and Support
Installation prerequisites
Building and Installing ACE
Building and Installing ACE Network Services
Building and Installing The ACE_SSL Library
Building and Using GUI Reactors Libraries
Installation Notes
Compiling ACE with GNU g++
What Do I Need to Build for TAO?
System Resource Requirements
General MPC Information
Working with ACE in Eclipse
Advanced Topics
Building from Subversion

文档索引
平台, c++编译器和支持
安装前的准备
生成和安装ACE
生成和安装ACE网络服务
生成和安装ACE_SSL库
生成和使用GUI Reactors库
安装笔记
用GNU g++编译ACE
生成支持TAO的版本我需要什么?
系统资源要求
一般的MPC信息
在Eclipse中和ACE工作
高级主题
从subversion生成

Building and Installing ACE on Windows with Microsoft Visual Studio
ACE contains project files for Microsoft Visual Studio .NET 2003 (VC7.1) and Visual Studio 2005 (VC8). Visual Studio 2005 supports building for desktop/server Windows as well as for Windows CE and Windows Mobile. Since not all users will be interested in the CE/Mobile capability, these platforms have separate solution and project files from the desktop/server Windows. Furthermore, VC7.1 and VC8 use different file formats but the same file suffixes (.sln and .vcproj). To support both environments, ACE supplies files with different names for the different development and target platforms. The platform/name mapping is shown below. All solution files have a .sln suffix and all project files have a .vcproj suffix.
在VS上生成和安装ACE
ACE中包含了针对vs2003(vc7.1)和VS2005(vc8)的文件.vs2005vs2005支持生成桌面、服务器、wince和Windows Mobile系统。并不是所有的用户都对CE/Mobiile系统感兴趣,那些平台由单独的解决方案和工程文件。此外,vc7.1和vc8用不同的文件格式,但相同的文件后缀(.sln和.vcproj).为了支持两个不同的环境,ACE支持文件为不同的开发环境和目标平台用不同的名字。平台名字和映射如下表。所有的解决方案,都是有一个.sln后缀,所有的工程都有一个.vcproj后缀。

Mapping of Platform to Solution/Project File Name Platform File Name
平台解决方案和项目文件名映射表
VC7.1 name (no decorator) 
VC8 for desktop/server name_vc8 
VC8 for Windows CE/Mobile name_WinCE 

If you happen to open a VC7.1 file from within VC8, it will offer to convert the file to the newer format for you. With the stock VC8, do not do this; Visual Studio will crash while attempting to convert the large solution and project files to build ACE. Simply refuse the conversion and open the file with the correct format. Note that Microsoft has fixed this problem. See https://msdn.microsoft.com/visualc/downloads/default.aspx for information.
不要使用不同版本的vc去打开不对应的ACE版本

Uncompress the ACE distribution into a directory, where it will create a ACE_wrappers directory containing the distribution. The ACE_wrappers directory will be referred to as ACE_ROOT in the following steps -- so ACE_ROOT\ace would be C:\ACE_wrappers\ace if you uncompressed into the root directory.


Create a file called config.h in the ACE_ROOT\ace directory that contains:

#include "ace/config-win32.h"


The static, DLL and MFC library builds are kept in different workspaces. Files with names *_Static contain project files for static builds. Workspaces for static and DLL builds will be available through the stock release at DOC group's website. The workspaces for MFC are not available and have to be generated using MPC. Please see MPC's README for details.


Now load the solution file for ACE (ACE_ROOT/ACE.sln).


Make sure you are building the configuration (i.e, Debug/Release) the one you'll use (for example, the debug tests need the debug version of ACE, and so on). All these different configurations are provided for your convenience. You can either adopt the scheme to build your applications with different configurations, or use ace/config.h to tweak with the default settings on NT.
Note: If you use the dynamic libraries, make sure you include ACE_ROOT\lib in your PATH whenever you run programs that uses ACE. Otherwise you may experience problems finding ace.dll or aced.dll.


If you want to use the standard C++ headers (iostream, cstdio, ... as defined by the C++ Standard Draft 2) that comes with MSVC, then add the line:

#define ACE_HAS_STANDARD_CPP_LIBRARY 1

before the #include statement in ACE_ROOT\ace\config.h.


To use ACE with MFC libraries, also add the following to your config.h file. Notice that if you want to spawn a new thread with CWinThread, make sure you spawn the thread with THR_USE_AFX flag set.

#define ACE_HAS_MFC 1

By default, all of the ACE projects use the DLL versions of the MSVC run-time libraries. You can still choose use the static (LIB) versions of ACE libraries regardless of run-time libraries. The reason we chose to link only the dynamic run-time library is that almost every NT box has these library installed and to save disk space. If you prefer to link MFC as a static library into ACE, you can do this by defining ACE_USES_STATIC_MFC in your config.h file. However, if you would like to link everything (including the MSVC run-time libraries) statically, you'll need to modify the project files in ACE yourself.

Static version of ACE libraries are built with ACE_AS_STATIC_LIBS
defined. This macro should also be used in application projects that link to static ACE libraries

Optionally you can also add the line

#define ACE_NO_INLINE

before the #include statement in ACE_ROOT\ace\config.h to disable inline function and reduce the size of static libraries (and your executables.)


ACE DLL and LIB naming scheme:

We use the following rules to name the DLL and LIB files in ACE when using MSVC.

"Library/DLL name" + (Is static library ? "s" : "") + (Is Debugging enable ? "d" : "") + {".dll"|".lib"}


More information for ACE/TAO on MSVC can be found here. The doxygen version of this document is available under Related Topics in the ACE Library.

ACE TESTS
The tests are located in ACE_ROOT\tests. There is also a solution in that directory to build all the tests (tests.sln)

Once you build all the tests (Batch Build works well for this), you can run perl script run_test.pl in the tests directory to try all the tests.

posted on 2008-03-18 01:11 AlanTop 阅读(2967) 评论(1)  编辑 收藏 引用 所属分类: VC++

评论

# re: ACE 5.6版本的编译  回复  更多评论   

不错,如此简单,
简单的不适宜放在首页了 呵呵
2008-03-18 08:28 | cppexplore

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理