Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6658541
  • 博文数量: 915
  • 博客积分: 17977
  • 博客等级: 上将
  • 技术积分: 8846
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-26 09:59
个人简介

一个好老好老的老程序员了。

文章分类

全部博文(915)

文章存档

2022年(9)

2021年(13)

2020年(10)

2019年(40)

2018年(88)

2017年(130)

2015年(5)

2014年(12)

2013年(41)

2012年(36)

2011年(272)

2010年(1)

2009年(53)

2008年(65)

2007年(47)

2006年(81)

2005年(12)

分类: C/C++

2011-06-16 10:25:54

I compiled log4cxx on my computer,(os:xp, IDE:vs2008)
I have 4 project folders in one same directory,(apr,apr-util,apr-iconv,apache-log4cxx),and open apache-log4cxx dsw and set it as startup and build.
apr,apr-util , log4cxx and xml are all compiled successfully, but when linking,it occurs errors below.
I try to add apr-iconv/include dir to log4cxx,but it dosen't matter. why?
.......
asyncappender.cpp
aprinitializer.cpp
appenderskeleton.cpp
appenderattachableimpl.cpp
action.cpp
Generating Code...
Compiling resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
Creating library .\Debug/log4cxx.lib and object .\Debug/log4cxx.exp
aprutil-1.lib(xlate.obj) : error LNK2019: unresolved external symbol _apr_iconv_open@16 referenced in function _apr_xlate_open@16
aprutil-1.lib(xlate.obj) : error LNK2019: unresolved external symbol _apr_iconv_close@8 referenced in function _apr_xlate_cleanup
aprutil-1.lib(xlate.obj) : error LNK2019: unresolved external symbol _apr_iconv@24 referenced in function _check_sbcs
.\Debug/log4cxx.dll : fatal error LNK1120: 3 unresolved externals
Build log was saved at file://e:\cpp_dev\apache-log4cxx\projects\Debug\BuildLog.htm
 
Answer:
did you run configure-aprutil.bat ?
there is no sed util on windows by default, so it probably did notheng, then try to do it with your own hands
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

it means find the macro definition of APR_HAS_LDAP, APU_HAVE_APR_ICONV and set it to 0. originaly they are defined as 1.
阅读(2838) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

renxiao20032011-06-16 10:27:20

建议安装cygwin,因为sed for windows不支持-i参数。