在Windows上将Apache Portable Runtime (APR)编译为DLL
来源:互联网 发布:量子破碎剧情 知乎 编辑:程序博客网 时间:2024/04/30 06:44
因最近要用到ActiveMQ的C++客户端ActiveMQ-CPP,需要在Windows下先编译APR。编译前需要下载解压APR,准备好Visual C++ 6.0。
APR的源代码下载地址为http://apr.apache.org/,需要下载3个部分:APR、APR-util、APR-iconv的Win32源代码。一般下载最新版本即可。目前最新版本对应的文件名分别为apr-1.5.0-win32-src.zip、apr-iconv-1.2.1-win32-src-r2.zip、apr-util-1.5.3-win32-src.zip。将这3个文件下载到同一个目录下,例如D:\Apache。
下载后将这3个文件分别解压到各自的目录,然后将这3个子目录去掉目录名里的版本号。即改名后的3个子目录分别为:D:\Apache\apr、D:\Apache\apr-iconv、D:\Apache\apr-util。这3个子目录名称必须是apr、apr-iconv、apr-util,不能为其它名称。
在VC(推荐使用VC6,高版本的VC可能会碰到链接错误)里打开Workspace文件D:\Apache\apr-util\aprutil.dsw 。在Win32 Release模式下编译libaprutil这个工程,libaprutil依赖的libapr、libapriconv这2个工程会被自动编译。lib开头的工程生成DLL,非lib开头的工程生成静态库。编译成功后,可以分别在3个工程的Release目录下找到DLL文件:libapr-1.dll、libapriconv-1.dll、libaprutil-1.dll,以及LIB文件:libapr-1.lib、libaprapp-1.lib、libapriconv-1.lib、libaprutil-1.lib、xml.lib。
在编译过程中可能会碰到以下错误:
错误1:找不到strings.h和inet.h
错误信息:apr/include/apr_want.h(52): Could not find the file strings.h
apr/include/apr_want.h(121): Could not find the file arpa/inet.h
解决方法: 打开文件apr\include\apr_want.h,分别注释掉以下2行:
#include <strings.h>
#include <arpa/inet.h>
错误2:不支持LDAP v2.0
错误信息: ./include\apr_ldap.h(136) : fatal error C1189: #error : Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
解决方法: 打开apr-util/include/apr_ldap.h ,注释此行:#error Support for LDAP v2.0 toolkits has been removed from apr-util. Please use an LDAP v3.0 toolkit.
错误3:找不到文件apr.h
错误信息:Could not find the file apr.h
解决方法:apr.h是编译时从apr.hw自动生成的,再次编译时此错误会自动消失。
- 在Windows上将Apache Portable Runtime (APR)编译为DLL
- [转载] 在Windows上将Apache Portable Runtime (APR)编译为DLL
- 在Windows上将CPPUNIT编译为DLL
- apr -- Apache Portable Runtime
- Apache Portable Runtime (APR) project
- 在Windows上将ActiveMQ-CPP编译为DLL
- 使用apache portable runtime 编译程序 apr
- APR(Apache Portable Runtime)的安装
- Centos下Tomcat 安装 apr (Apache Portable Runtime)
- tomcat 安装 apr (Apache Portable Runtime), tomcat-native.
- tomcat 安装 apr (Apache Portable Runtime), tomcat-native.
- tomcat 性能优化之APR(Apache Portable Runtime)
- tomcat 安装 apr (Apache Portable Runtime), tomcat-native.
- Apache Portable Runtime (APR) based Native library for Tomcat
- 在Linux上安装Apache Portable Runtime
- apache portable runtime tutorial
- Apache Portable Runtime部署
- SVN安装问题The Apache Portable Runtime (APR) library cannot be found
- 实例设计模式1《策略模式》
- TOJ:3210. Moon Mooing
- 堆 && 堆排序
- Android模拟器源码Qemu Study for Android Emulator
- 深入理解D3D9
- 在Windows上将Apache Portable Runtime (APR)编译为DLL
- 用MFC构造DIRECTX应用框架
- zigbee体系架构
- D3D常用数学函数
- D3DFVF_XYZ和D3DFVF_XYZRHW的区别
- 【Linux】一些新手常用的命令
- 超大地图MMORPG的场景管理
- mysql 多表update更新语句
- 物体移動