基于VS2015编译Yate
1前言
之前使用vs2010对yate的学习,随着vs的升级和更新,我们将使用vs2015继续对Yate进行学习。本文记载基于vs2015编译Yate的一些问题。
2问题一:编译Service失败
问题描述:
2>C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(392,5):warning MSB8028: The intermediate directory (.\Debug\engine\) contains filesshared from another project (libregex.vcxproj). This can lead to incorrect clean and rebuild behavior.
2> YSHA256.cpp
2> YSHA1.cpp
2> YMD5.cpp
2> XML.cpp
2> URI.cpp
2> Thread.cpp
2> TelEngine.cpp
2>C:\Program Files (x86)\WindowsKits\10\Include\10.0.10240.0\ucrt\stdio.h(1419): warning C4005: “vsnprintf”: 宏重定义
2> D:\学习文档\Yate\yate\yateclass.h(86): note: 参见“vsnprintf”的前一个定义
2>C:\Program Files (x86)\WindowsKits\10\Include\10.0.10240.0\ucrt\stdio.h(1421): fatal error C1189:#error: Macro definition of vsnprintfconflicts with Standard Library function declaration
2> String.cpp
2>C:\Program Files (x86)\WindowsKits\10\Include\10.0.10240.0\ucrt\stdio.h(1419): warning C4005: “vsnprintf”: 宏重定义
2> D:\学习文档\Yate\yate\yateclass.h(86): note: 参见“vsnprintf”的前一个定义
2>C:\Program Files (x86)\WindowsKits\10\Include\10.0.10240.0\ucrt\stdio.h(1421): fatal error C1189:#error: Macro definition of vsnprintfconflicts with Standard Library function declaration
解决方式:
通过错误描述可知,是因为vsnprintf和snprintf重定义的原因,vs2015已经对vsnprintf和snprintf的支持。在yate\yateclass.h(86)文件中注释掉86和87行即可;
编译结果: