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) |