现在的位置: 首页 > 综合 > 正文

下载编译log4cxx

2013年07月06日 ⁄ 综合 ⁄ 共 1027字 ⁄ 字号 评论关闭

1. 下载源文件
地址:http://www.apache.org/dyn/closer.cgi/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.zip
下载后解压
2. 下载软件包
地址:
 http://archive.apache.org/dist/apr/apr-1.2.11-win32-src.zip
 http://archive.apache.org/dist/apr/apr-util-1.2.10-win32-src.zip
下载后分别解压,分别将文件夹改名为apr和apr-util
3. 运行cmd到达...\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0目录下
运行configure命令
4. 下载并运行cygwin
用命令到...\apache-log4cxx-0.10.0\apache-log4cxx-0.10.0目录下,运行configure-aprutil.bat文件中最后两个命令(需要改一下),
sed -i -e "s/#define APU_HAVE_APR_ICONV\b.*/#define APU_HAVE_APR_ICONV 0/" ..\apr-util\include\apu.hw
sed -i -e "s/#define APR_HAS_LDAP\b.*/#define APR_HAS_LDAP 0/" ..\apr-util\include\apr_ldap.hw
要注意:需要改一下路径显示
sed -i -e "s/#define APU_HAVE_APR_ICONV\b.*/#define APU_HAVE_APR_ICONV 0/" ../apr-util/include/apu.hw
sed -i -e "s/#define APR_HAS_LDAP\b.*/#define APR_HAS_LDAP 0/" ../apr-util/include/apr_ldap.hw
5. 打开projects文件夹下的log4cxx.dsw项目,开始编译,应该可以顺利通过
6. projects目录下会生成debug或release文件夹,下面就是生成的库
7. 使用时,添加附加包含目录,...../ apache-log4cxx-0.10.0/src/main/include,连接器的输入为log4cxx.lib,附加库的目录为生成的debug或release文件夹

现在就可以使用了,用例可以从网上查到

抱歉!评论已关闭.