- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 Visual Studio 2013 下构建 log4cxx 版本 0.10.0。我已经完成了 building log4cxx in vs 2010 c++ 中指定的所有修复。 .
但是,当尝试创建 log4cxx.lib 时,它现在在链接阶段失败,并出现以下错误:
unresolved external symbol __InterlockedIncrement referenced in function _apr_atomic_inc32@4
unresolved external symbol __InterlockedExchangeAdd referenced in function _apr_atomic_add32@8
unresolved external symbol __InterlockedExchange referenced in function _apr_atomic_set32@8
unresolved external symbol __InterlockedDecrement referenced in function _apr_atomic_dec32@4
unresolved external symbol __InterlockedCompareExchange referenced in function _apr_atomic_cas32@12
根据 MSDN,这些函数应该在 kernel32.lib 中,我已将其添加到链接器中,但没有效果。查看 ht elib,这似乎包含 _InterlockedIncrement
(单下划线)和 _imp_InterlockedIncrement
有谁知道我可以做些什么来让它工作?
此外,Building log4cxx with VS 2012 on Windows 7 中建议的修复没有什么不同
最佳答案
以下过程是在 VS2013 下构建 Log4CXX 的完整过程,适用于 32 位和 64 位构建。请注意,32 位版本已经过非常简单的测试,而 64 位版本已经过稍微广泛的测试(即,这是我们正在使用的版本)。
apache-log4cxx-0.10.0.zip
、apr-x.y.z-win32.src.zip
和 apr-util-1.5.4-win32 .src.zip
,其中x
、y
和z
为最新版本。apr-x.y.z
和 apr-utls-x.y.z
以删除版本号。log4cxx
中的文件。见下文。对于 32 位版本,补丁 apr\atomic\win32\apr_atomic.c
。
替换所有 defined(_M_IA64) ||已定义(_M_AMD64))
与 已定义(_M_IA64) ||定义(_M_AMD64)|| (_MSC_VER == 1800))
这实际上只是一个临时修复,但它确实有效。
apache-log4cxx-0.10.0\configure.bat
。apr-util
。
include\apu.hw
中,将APU_HAVE_APR_ICONV
定义为0。include\apr_ldap.hw
中,将 APR_HAS_LDAP
定义为 0。apache-log4cxx-0.10.0\projects\log4cxx.dsw
加载到 Visual Studio 2013 中。系统将提示您升级项目。接受并等待转换完成。这将创建 log4cxx.sln
,您应该在下次打开项目时使用它Build->Configuration Manager
。为 log4cxx
创建 x64 项目上下文,包括发布和调试。检查这些项目的构建框。Upgrade VC++ compiler ...
。log4cxx
项目,然后选择 properties
。
调试/所有平台
配置设置。Configuration Properties/General/Target name
设置为将“_d”作为文件名的结尾。Linker/All Options/Output File
以“_d”作为文件名的结尾。Linker/All Options/Import Library
将“_d”作为文件名的结尾。Build -> Configuration manager
中选择适当的事件解决方案配置和平台。下面是log4cxx
所需的补丁。
diff -r .\archives\apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp .\build_official_2\apache-log4cxx-0.10.0/src/main/cpp/loggingevent.cpp
127c127
< LoggingEvent::KeySet LoggingEvent::getMDCKeySet() const
---
> KeySet LoggingEvent::getMDCKeySet() const
129c129
< LoggingEvent::KeySet set;
---
> KeySet set;
188c188
< LoggingEvent::KeySet LoggingEvent::getPropertyKeySet() const
---
> KeySet LoggingEvent::getPropertyKeySet() const
190c190
< LoggingEvent::KeySet set;
---
> KeySet set;
diff -r .\archives\apache-log4cxx-0.10.0/src/main/cpp/propertiespatternconverter.cpp .\build_official_2\apache-log4cxx-0.10.0/src/main/cpp/propertiespatternconverter.cpp
62c62
< LoggingEvent::KeySet keySet(event->getMDCKeySet());
---
> KeySet keySet(event->getMDCKeySet());
64c64
< for(LoggingEvent::KeySet::const_iterator iter = keySet.begin();
---
> for(KeySet::const_iterator iter = keySet.begin();
diff -r .\archives\apache-log4cxx-0.10.0/src/main/cpp/xmllayout.cpp .\build_official_2\apache-log4cxx-0.10.0/src/main/cpp/xmllayout.cpp
104,105c104,105
< LoggingEvent::KeySet propertySet(event->getPropertyKeySet());
< LoggingEvent::KeySet keySet(event->getMDCKeySet());
---
> KeySet propertySet(event->getPropertyKeySet());
> KeySet keySet(event->getMDCKeySet());
109c109
< for (LoggingEvent::KeySet::const_iterator i = keySet.begin();
---
> for (KeySet::const_iterator i = keySet.begin();
123c123
< for (LoggingEvent::KeySet::const_iterator i2 = propertySet.begin();
---
> for (KeySet::const_iterator i2 = propertySet.begin();
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/asyncappender.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/asyncappender.h
52a53
> LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr);
197c198
< LOG4CXX_LIST_DEF(LoggingEventList, log4cxx::spi::LoggingEventPtr);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/bytearrayinputstream.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/bytearrayinputstream.h
38a39
> LOG4CXX_LIST_DEF(ByteList, unsigned char);
42c43
< LOG4CXX_LIST_DEF(ByteList, unsigned char);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/bytearrayoutputstream.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/bytearrayoutputstream.h
40a41
> LOG4CXX_LIST_DEF(ByteList, unsigned char);
44c45
< LOG4CXX_LIST_DEF(ByteList, unsigned char);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/simpledateformat.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/simpledateformat.h
45a46
> LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*);
78c79
< LOG4CXX_LIST_DEF(PatternTokenList, log4cxx::helpers::SimpleDateFormatImpl::PatternToken*);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/socketoutputstream.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/helpers/socketoutputstream.h
35c35
<
---
> LOG4CXX_LIST_DEF(ByteList, unsigned char);
53c53
< LOG4CXX_LIST_DEF(ByteList, unsigned char);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/net/sockethubappender.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/net/sockethubappender.h
105c105
<
---
> LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr);
115c115
< LOG4CXX_LIST_DEF(ObjectOutputStreamList, log4cxx::helpers::ObjectOutputStreamPtr);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/net/telnetappender.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/net/telnetappender.h
67c67,69
< class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton
---
> typedef log4cxx::helpers::SocketPtr Connection;
> LOG4CXX_LIST_DEF(ConnectionList, Connection);
> class LOG4CXX_EXPORT TelnetAppender : public AppenderSkeleton
134,135d135
< typedef log4cxx::helpers::SocketPtr Connection;
< LOG4CXX_LIST_DEF(ConnectionList, Connection);
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/patternlayout.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/patternlayout.h
326a327,328
> LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr);
> LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
337c339
< LOG4CXX_LIST_DEF(LoggingEventPatternConverterList, log4cxx::pattern::LoggingEventPatternConverterPtr);
---
>
343c345
< LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/rolling/rollingpolicybase.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/rolling/rollingpolicybase.h
44a45,46
> LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr);
> LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
60c62
< LOG4CXX_LIST_DEF(PatternConverterList, log4cxx::pattern::PatternConverterPtr);
---
>
66c68
< LOG4CXX_LIST_DEF(FormattingInfoList, log4cxx::pattern::FormattingInfoPtr);
---
>
diff -r .\archives\apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h .\build_official_2\apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h
54a55
> LOG4CXX_LIST_DEF(KeySet, LogString);
155c156
< LOG4CXX_LIST_DEF(KeySet, LogString);
---
>
关于visual-studio-2013 - 在 visual studio 2013 下构建 log4cxx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26612338/
不同的 LogCat 方法是: Log.v(); // Verbose Log.d(); // Debug Log.i(); // Info Log.w(); // Warning Log.e();
在android群里,经常会有人问我,android log是怎么用的,今天我就把从网上以及sdk里东拼西凑过来,让大家先一睹为快,希望对大家入门android log有一定的帮助. android
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 4 年前。 社区 12
我正在尝试使用 sonarlint 检查代码质量.上面的问题概要,我不明白为什么它要说要大写。但是 this discussion与上述建议相反。哪一个应该被认为是正确的? 最佳答案 这没有正确答案,
随着 n 变大,log*(log n) 和 log(log* n) 这两个函数会更快吗? 这里,log* 函数是迭代对数,定义如下: 我怀疑它们是相同的,只是写法不同,但它们之间有什么区别吗? 最佳答
作为家庭作业,我被要求在 O(log(n)) 中编写一个算法,我可以计算出我编写的算法的复杂度为 O(log(n) + log(n/2) + log(n/4) + log(n/8) + ... + l
我正在使用 Tomee。日志文件夹包含这样的文件 localhost_access_log.2016-12-02.txt localhost.2016-12-02.log catalina.2016-
Android Log.v、Log.d、Log.i、Log.e 等的 ios 等效项是什么?同样在 android 上,我使用 Android 设备监视器和 logcat 来访问我的手机日志,我需要在
我认为下面的代码是 O(log log n) 因为它里面有 i*i 但我对 log n 感到困惑> 和 log (log n)。 for (i=2; i*i<=number; i++) { if
我正在修改 kvm 模块,并在内核代码中添加了 printk 语句。运行虚拟机后,printk 为我提供了错误地址和有关 guest 操作系统的其他信息。 我需要从这个信息中生成统计信息。当我使用 d
我有一个部署为 Windows Azure Web 角色的 WCF 服务。 我正在使用 Enterprise Library 进行异常处理,并且在我的本地 Development Fabric 中,似
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 9 年前。 Improv
在 Go 的生产中使用 log.SetFlags(log.LstdFlags | log.Lshortfile) 是好的做法(至少是一般做法)吗?我想知道在生产中这样做是否存在性能或安全问题。因为它不
我想知道什么更快: double value = Math.log(a) - Math.log(b); 或 double value = Math.log(a/b); 我计算值的方式是否会对性能产生影
我有数百个子例程使用 log.Println() 写入日志文件 我正在使用 log.Println 写入 error.log 文件。 func main() { e, err := os.Open
我将 Nuxt 与 SSR 一起使用,并希望有类似于 apaches 的 access.log 和 error.log 的东西 我特别感兴趣的是每次调用的响应时间。 我在 nuxt 文档中找不到任何内
我知道以前有人问过这个问题,但我相信这是一个不同的问题。 Nginx 在 www-data 下运行: $ ps -eo "%U %G %a" | grep nginx root root
我在我的日志文件中发现了一个非常奇怪的条目 Jan 29 01:35:30 vs-proj-handy sshd[5316]: Received disconnect from 130.207.203
对于我正在开发的应用程序,我希望在开发过程中和发布时简化故障排除。我希望能够检索到对 Log 的调用,以了解在 USB 调试中没有连接手机的情况下运行应用程序时的调用,以便可以检索并发送给我。例如,当
我试图捕获 panic 并记录错误: func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRep
我是一名优秀的程序员,十分优秀!