vs2015 编译obs studio 遇到的几个错误
1.? >D:projectvsobsObsProjectobs-studiopluginswin-wasapiwin-wasapi.cpp(245): error C2065: “KSAUDIO_SPEAKER_2POINT1”: 未声明的标识符 解决方案: 再win-wasapi.cpp 内添加定义KSAUDIO_SPEAKER_2POINT1 宏: #define KSAUDIO_SPEAKER_2POINT1 (KSAUDIO_SPEAKER_STEREO|SPEAKER_LOW_FREQUENCY)
2. D:projectvsobsObsProjectobs-studiopluginswin-wasapiwin-wasapi.cpp(245): error C2051: case 表达式不是常量 解决方案: 参考之前版本的json11 然后提换一下现在的json11文件。 具体差异: 再 json11.hpp 添加: // declval example using namespace std; 然后下面提换内容: //此处最新版的代码编译会有问题所以注释起来还是使用之前版本的代码进行编译 by_songgp add20190422 /* // Implicit constructor: anything with a to_json() function. template <class T,class = decltype(&T::to_json)> Json(const T & t) : Json(t.to_json()) {} // Implicit constructor: map-like objects (std::map,std::unordered_map,etc) template <class M,typename std::enable_if<std::is_constructible<std::string,decltype((std::declval<M>()).begin()->first)>::value&& std::is_constructible<Json,decltype(std::declval<M>().begin()->second)>::value,int>::type = 0> Json(const M & m) : Json(object(m.begin(),m.end())) {} // Implicit constructor: vector-like objects (std::list,std::vector,std::set,etc) template <class V,typename std::enable_if<std::is_constructible<Json,decltype(*std::declval<V>().begin())>::value,int>::type = 0>Json(const V & v) : Json(array(v.begin(),v.end())) {} // This prevents Json(some_pointer) from accidentally producing a bool. Use // Json(bool(some_pointer)) if that behavior is desired. Json(void *) = delete; // Accessors Type type() const; */ // Implicit constructor: anything with a to_json() function. template <class T,class = decltype(&T::to_json)> Json(const T & t) : Json(t.to_json()) {} // Implicit constructor: map-like objects (std::map,etc) template <class M,typename std::enable_if< std::is_constructible<std::string,typename M::key_type>::value && std::is_constructible<Json,typename M::mapped_type>::value,int>::type = 0> Json(const M & m) : Json(object(m.begin(),m.end())) {} // Implicit constructor: vector-like objects (std::list,etc) template <class V,typename std::enable_if< std::is_constructible<Json,typename V::value_type>::value,int>::type = 0> Json(const V & v) : Json(array(v.begin(),v.end())) {} // This prevents Json(some_pointer) from accidentally producing a bool. Use // Json(bool(some_pointer)) if that behavior is desired. Json(void *) = delete; // Accessors Type type() const; 3. -preview.cpp(932): error C2719: ‘transform‘: formal parameter with requested alignment of 16 won‘t be aligned 原因可能是因为vs2015 编译的是win3? 解决方案: 修改??window-basic-preview.cpp 文件中 static bool IntersectBox(matrix4 transform,float x1,float x2,float y1,float y2) 为下面的内容: static bool IntersectBox(matrix4& transform,float y2) 参考: https://blog.csdn.net/kupepoem/article/details/44239193 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |