windows下用VC6.0和stlport 5.1.4编译log4cplus 1.02

来源:互联网 发布:2016中国出口数据 编辑:程序博客网 时间:2024/05/19 07:07

打开log4cplus目录下的msvc6的log4cplus.dsw,build->set active configuration, 选中 log4cplusdll -win32 debug。在settings里面配置好stlport lib库的路径。将options里面的目录stlport的路径调到原有vc自带路径的最前面。开始编译,出下面的错误:

log4cplus-1.0.2/src/configurator.cxx(344) : error C2065: 'bind1st' : undeclared identifier

 bind1st,bind2nd都是标准模板库所带的函数,在标准模板库,放在<algorithm>但在stlport里面,放到了<functional>里面。因此,在configurator.cxx文件开始部位增加#include <functional>
编译即完成。同样步骤,应用到release的编译。

在编译可执行程序时还碰到一个怪问题。setting里面没有任何stlport 5.0的东西,引入库也是stlport5.1.4.lib,但执行程序时总提示需要stlport5.0.dll,后面用dependence才发现是log4cplus里面使用了stlport5.0的库生成的。

原创粉丝点击