您的位置:首页 > 编程语言 > Java开发

在ubuntu下安装ACE编译环境 和 Eclipse 开发环境

2012-05-07 18:23 495 查看
可以用新立得软件管理工具安装 libace-dev libace-doc这两个包

或者在控制台上用apt-get install libace-dev libace-doc命令来安装

1.使用http://riverace.com/downloads.htm#ace_releases下载下来的ACE包进行编译:

2.先用gedit /home/username/.bashrc 打开脚本文件,并在上面加上一下环境变量

#ACE env

export ACE_ROOT=/home/username/ACE_wrappers

export MPC_ROOT=$ACE_ROOT/MPC

export LD_LIBRARY_PATH=$ACE_ROOT/lib:/usr/local/lib/sparcv9:/usr/openwin/lib:/usr/lib:/usr/local/lib

export PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH};${HOME}/bin"

3.进入 $ACE_ROOT/ace目录,创建一个文本 config.h,内容如下:

#include "ace/config-linux.h"

或者用 ln -s config-linux.h config.h 命令

4.进入$ACE_ROOT/include/makeinclude目录,创建一个文本文件 platform_macros.GNU,内容如下:

include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

或者用 ln -s platform_linux.GNU platform_macros.GNU 命令

然后进入ace文件夹

make

make install

进行编译。

如果没有问题,将会在bulid(or ace)文件夹里找到

libACE.so libACE.so.5 libACE.so.5.4.0文件

把 libACE.so.5.*.* 复制 到 /usr/lib 下
-------------------------
不需要这么复杂吧,ACE5.4以后的版本支持GNU Autoconf编译,假设代码在/opt/ACE_wrappers目录下

mkdir /opt/ACE_wrappers/build

cd /opt/ACE_wrappers/build

../configure

make

make install (optional)

就可以了,默认只编译共享库(libACE.so),如果想编译静态库(libACE.a),可以在configure的时候加--enable-static
--
如果报错:
1.如果按照上述说明中的安装方法,第五步可能会出现问题,一般在自行编译源码所碰到的错误都会是系统缺少软件包所致,我所遇到的问题是跟ssl有关系,告警如下: http://www.cnblogs.com/../ace/SSL/SSL_Asynch_BIO.h:29:25: error: openssl/bio.h: 没有那个文件或目录
原因:缺少openssl或者找不到openssl的头文件;
解决:去http://www.openssl.org/source/下载latest程序,经过一番./configure、make、make install安装套路,还有一步为做个链接:
cd /usr/include
ln -s /usr/local/ssl/include/openssl openssl
具体安装流程:
安装openssl
# tar –zxvf openssl
# cd openssl
# ./config --prefix=/usr/local/openssl
# make
# make install
cd /usr/include
ln -s /home/yourusername/bin/openssl/include/openssl openssl

2.又遇到错误,如下:
home/knight/libs/ACE_wrappers/objdir/examples/IPC_SAP/SSL_SAP/http://www.cnblogs.com/http://www.cnblogs.com/ace/SSL/SSL_SOCK_Stream.inl:148: undefined reference to `SSL_read'

/home/knight/libs/ACE_wrappers/objdir/examples/IPC_SAP/SSL_SAP/http://www.cnblogs.com/http://www.cnblogs.com/ace/SSL/SSL_SOCK_Stream.inl:151: undefined reference to `SSL_get_error'

client-SSL-client.o: In function `ACE_SSL_SOCK_Stream::close()':

/home/knight/libs/ACE_wrappers/objdir/examples/IPC_SAP/SSL_SAP/http://www.cnblogs.com/http://www.cnblogs.com/ace/SSL/SSL_SOCK_Stream.inl:305: undefined reference to `SSL_shutdown'
原因:在编译${ACE_ROOT}/objdir/tests/SSL和${ACE_ROOT}/examples/IPC_SAP/SSL_SAP中makefile指定的库路径LIBS指定有误;

解决:找到makefile里的LIBS = -lrt -ldl,在后面添加路径【 /usr/local/ssl/lib/libssl.a /usr/local/ssl/lib/libcrypto.a】(注意,这两个静态库路径不是绝对的)。
---
LIBS = -lrt -ldl /home/yourusername/bin/openssl/lib/libssl.a /home/yourusername/bin/openssl/lib/libcrypto.a
------------------------
配置Eclipse:
1. 点击project->properties,打开,在左侧一览中选择C/C++ Build,在TAB列中选择tools settings,

点中gcc c++ compiler中的directories,增加你的ACE根目录 "/home/***/ACE_wrappers"
2. 点中gcc c++ linker
在 libraries (-l) 中 写入 ACE

在 library search path(-L) 中 写入 "/home/***/ACE_wrappers/ace"
完成配置。

转帖:http://hi.baidu.com/dongbeiman/blog/item/1e8e18c7569489cfd100609a.html
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
在ubuntu下有三种方法:

一、可以用新立得软件管理工具安装 libace-dev libace-doc这两个包

二、或者在控制台上用apt-get install libace-dev libace-doc命令来安装

三、手动编译,步骤如下:

1.使用http://riverace.com/downloads.htm#ace_releases下载下来的ACE包进行编译:

2.先用gedit /home/username/.bashrc 打开脚本文件,并在上面加上一下环境变量

#ACE env

export ACE_ROOT=/home/username/ACE_wrappers

export MPC_ROOT=$ACE_ROOT/MPC

export LD_LIBRARY_PATH=$ACE_ROOT/lib:/usr/local/lib/sparcv9:/usr/openwin/lib:/usr/lib:/usr/local/lib:

export PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH};${HOME}/bin"

3.进入 $ACE_ROOT/ace目录,创建一个文本 config.h,内容如下:

#include "ace/config-linux.h"

或者用 ln -s config-linux.h config.h 命令

4.进入$ACE_ROOT/include/makeinclude目录,创建一个文本文件 platform_macros.GNU,内容如下:

include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

或者用 ln -s platform_linux.GNU platform_macros.GNU 命令

然后进入ace文件夹

make

make install

进行编译。

如果没有问题,将会在bulid文件夹里找到

libACE.so libACE.so.5 libACE.so.5.4.0文件

原链接:http://blog.csdn.net/tomhsh/archive/2008/07/21/2685718.aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: