Linux 下编译安装ACE时遇到的问题及解决


首先把文件解压,我解压在了/Software文件夹下,解压后会出现一个名字为ACE_wrappers的文件夹。这样所有ACE的源文件都在/Software/ACE_wrappers里面

1.1    配置环境变量:

# vi /etc/profile

增加如下的内容

ACE_ROOT=/Software/ACE_wrappers ------就是上面存放ACE源文件的目录

export ACE_ROOT

LD_LIBARY_PATH=$ACE_ROOT/ace:$LD_LIBARY_PATH

export LD_LIBARY_PATH

# source /etc/profile

1.2    开始安装ACE

# cd /Software/ACE_wrappers

# vi ace/config.h

增加如下信息:

#include “ace/config-linux.h”

如果想用MSVC标准C++头,www.bkjia.com则需要在ace/config.h中增加定义:

#define ACE_HAS_STANDARD_CPP_LIBARY 1

我的config.h文件内容如下:

#define ACE_HAS_STANDARD_CPP_LIBARY 1 // 使用标准C++头

#define ACE_NO_INLINE // 不使用内连函数,能减小LIB和EXE的大小

#include “ace/config-linux.h”

保存后退出

# mkdir build ----新建一个build文件夹

# cd build

# ../configure --prefix=/usr/local/ACE -------在这里我指定了ACE的安装路径

# make & install

第一个问题,在make的时候找不到了ssl这个东西。。这个ssl具体来说是网络上一个安全协议。系统默认是安装的,但是我在编译时候一直出现这个问题,原来是打开了。我的版本号是6.0的。所以,经过查找帮助文档,configure这个配置的时候

--enable-ssl (yes): Include the ACE_SSL library when building ACE. Requires the SSL components to be available using the compiler's and linker's default search directories.

--with-openssl: Specifies the root directory of the OpenSSL installation; expects the specified directory to have include and lib subdirectories. To specify other locations for the header and libraries, use one or both of the following.

--with-openssl-include: Specify the directory containing the OpenSSL header files.

--with-openssl-libdir: Specify the directory containing the OpenSSL libraries.

应该关闭它命令如下../configure --disable-ssl

在进行编译,就会成功了。

相关内容