转载请说明原出处,谢谢~~

首先感谢wke内核作者BlzFans和soui2作者flyhigh,使得基于webkit内核的浏览器控件小巧,易于使用。

wke的源码是基于vs2005和vs2008的工程,这对于现在公司的一些新项目而言,编译器版本太老了些,wke也就有了升级为高版本工程的需求。升级时,碰到了不少错误,查阅一些博客时候,发现也有不少寻找高版本工程的,不过升级的资料较少,看来大神们是不削于做这种工作的了,哈哈,开个玩笑。我就将自己升级时候碰到的一些问题,记录下来吧。

用vs2010或者vs2013直接升级时,从升级报告中可以看到很多错误,仔细查看都是“.vsprops”文件找不到这一类型错误,查看前面的路径可以知道,是该属性文件的路径有误。因此用记事本打开vs2008/vsprops/目录下面,名字中带有release和debug的文件,在其所有的路径前面增加“..\..\”,如图所示:

(为了方便,可以将这个vs2008文件夹复制2份出来,分别命名为vs2010,vs2013。)

直接用vs2010打开工程文件,可以看到升级报告里面已经没有错误了。接下来,就是处理丢失的各种工程属性和设置。在vs视图→属性管理器中展开各个项目的属性文件。依次处理每个属性页的 常规标签,用户宏标签,c/c++标签下面的常规、预处理器、预编译头、代码生成,高级,链接器标签下面的输入等。其中FeatureDefinesCairo用户宏比较多,可以从WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops中复制宏名。设置属性页时候,尽量先从list下方的属性页设置,上方的属性页选择从父级继承,有新的就添加。common属性页的WEBKITOUTPUTDIR按照自己工程设置输出目录,另外需要将ConfigurationBuiDir移动到最下面。

所有设置完成以后,vs2010工程就升级成功,可以编译通过了。

如果是vs2013,还会报大量模板语法错误,错误都指向了Source\JavaScriptCore\wtf\HashSet.h文件。如下修改HashSet.h文件。

/** Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.** This library is free software; you can redistribute it and/or* modify it under the terms of the GNU Library General Public* License as published by the Free Software Foundation; either* version 2 of the License, or (at your option) any later version.** This library is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU* Library General Public License for more details.** You should have received a copy of the GNU Library General Public License* along with this library; see the file COPYING.LIB.  If not, write to* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,* Boston, MA 02110-1301, USA.**/#ifndef WTF_HashSet_h
#define WTF_HashSet_h#include "FastAllocBase.h"
#include "HashTable.h"namespace WTF {template<typename Value, typename HashFunctions, typename Traits> class HashSet;template<typename Value, typename HashFunctions, typename Traits>void deleteAllValues(const HashSet<Value, HashFunctions, Traits>&);template<typename Value, typename HashFunctions, typename Traits>void fastDeleteAllValues(const HashSet<Value, HashFunctions, Traits>&);template<typename T> struct IdentityExtractor;template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash,typename TraitsArg = HashTraits<ValueArg> > class HashSet {WTF_MAKE_FAST_ALLOCATED;private:typedef HashArg HashFunctions;typedef TraitsArg ValueTraits;public:typedef typename ValueTraits::TraitType ValueType;private:typedef HashTable<ValueType, ValueType, IdentityExtractor<ValueType>,HashFunctions, ValueTraits, ValueTraits> HashTableType;public:typedef HashTableIteratorAdapter<HashTableType, ValueType> iterator;typedef HashTableConstIteratorAdapter<HashTableType, ValueType> const_iterator;void swap(HashSet&);int size() const;int capacity() const;bool isEmpty() const;iterator begin() ;iterator end() ;const_iterator begin() const;const_iterator end() const;iterator find(const ValueType&) ;const_iterator find(const ValueType&) const;bool contains(const ValueType&) const;// An alternate version of find() that finds the object by hashing and comparing// with some other type, to avoid the cost of type conversion. HashTranslator// must have the following function members://   static unsigned hash(const T&);//   static bool equal(const ValueType&, const T&);template<typename T, typename HashTranslator> iterator find(const T&);template<typename T, typename HashTranslator> const_iterator find(const T&) const;template<typename T, typename HashTranslator> bool contains(const T&) const;// The return value is a pair of an interator to the new value's location, // and a bool that is true if an new entry was added.pair<iterator, bool> add(const ValueType&);// An alternate version of add() that finds the object by hashing and comparing// with some other type, to avoid the cost of type conversion if the object is already// in the table. HashTranslator must have the following function members://   static unsigned hash(const T&);//   static bool equal(const ValueType&, const T&);//   static translate(ValueType&, const T&, unsigned hashCode);template<typename T, typename HashTranslator> pair<iterator, bool> add(const T&);void remove(const ValueType&);void remove(iterator);void clear();private:friend void deleteAllValues<>(const HashSet&);friend void fastDeleteAllValues<>(const HashSet&);HashTableType m_impl;};template<typename T> struct IdentityExtractor {static const T& extract(const T& t) { return t; }};template<typename ValueType, typename ValueTraits, typename T, typename Translator>struct HashSetTranslatorAdapter {static unsigned hash(const T& key) { return Translator::hash(key); }static bool equal(const ValueType& a, const T& b) { return Translator::equal(a, b); }static void translate(ValueType& location, const T& key, const T&, unsigned hashCode){Translator::translate(location, key, hashCode);}};template<typename T, typename U, typename V>inline void HashSet<T, U, V>::swap(HashSet& other){m_impl.swap(other.m_impl); }template<typename T, typename U, typename V>inline int HashSet<T, U, V>::size() const{return m_impl.size(); }template<typename T, typename U, typename V>inline int HashSet<T, U, V>::capacity() const{return m_impl.capacity(); }template<typename T, typename U, typename V>inline bool HashSet<T, U, V>::isEmpty() const{return m_impl.isEmpty(); }template<typename T, typename U, typename V>inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::begin() {return m_impl.begin(); }template<typename T, typename U, typename V>inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::end() {return m_impl.end(); }template<typename T, typename U, typename V>inline typename HashSet<T, U, V>::const_iterator HashSet<T, U, V>::begin() const{return m_impl.begin();}template<typename T, typename U, typename V>inline typename HashSet<T, U, V>::const_iterator HashSet<T, U, V>::end() const{return m_impl.end();}template<typename T, typename U, typename V>inline typename HashSet<T, U, V>::iterator HashSet<T, U, V>::find(const ValueType& value){return m_impl.find(value); }template<typename T, typename U, typename V>inline typename HashSet<T, U, V>::const_iterator HashSet<T, U, V>::find(const ValueType& value) const{return m_impl.find(value);}template<typename T, typename U, typename V>inline bool HashSet<T, U, V>::contains(const ValueType& value) const{return m_impl.contains(value); }template<typename Value, typename HashFunctions, typename Traits>template<typename T, typename HashTranslator>typename HashSet<Value, HashFunctions, Traits>::iteratorinline HashSet<Value, HashFunctions, Traits>::find(const T& value){typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;return m_impl.template find<T, Adapter>(value);}template<typename Value, typename HashFunctions, typename Traits>template<typename T, typename HashTranslator>typename HashSet<Value, HashFunctions, Traits>::const_iteratorinline HashSet<Value, HashFunctions, Traits>::find(const T& value) const{typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;return m_impl.template find<T, Adapter>(value);}template<typename Value, typename HashFunctions, typename Traits>template<typename T, typename HashTranslator>inline bool HashSet<Value, HashFunctions, Traits>::contains(const T& value) const{typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;return m_impl.template contains<T, Adapter>(value);}template<typename T, typename U, typename V>pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value){return m_impl.add(value);}template<typename Value, typename HashFunctions, typename Traits>template<typename T, typename HashTranslator>inline pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool>HashSet<Value, HashFunctions, Traits>::add(const T& value){typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);}template<typename T, typename U, typename V>inline void HashSet<T, U, V>::remove(iterator it){if (it.m_impl == m_impl.end())return;m_impl.internalCheckTableConsistency();m_impl.removeWithoutEntryConsistencyCheck(it.m_impl);}template<typename T, typename U, typename V>inline void HashSet<T, U, V>::remove(const ValueType& value){remove(find(value));}template<typename T, typename U, typename V>inline void HashSet<T, U, V>::clear(){m_impl.clear(); }template<typename ValueType, typename HashTableType>void deleteAllValues(HashTableType& collection){typedef typename HashTableType::const_iterator iterator;iterator end = collection.end();for (iterator it = collection.begin(); it != end; ++it)delete *it;}template<typename T, typename U, typename V>inline void deleteAllValues(const HashSet<T, U, V>& collection){deleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl);}template<typename ValueType, typename HashTableType>void fastDeleteAllValues(HashTableType& collection){typedef typename HashTableType::const_iterator iterator;iterator end = collection.end();for (iterator it = collection.begin(); it != end; ++it)fastDelete(*it);}template<typename T, typename U, typename V>inline void fastDeleteAllValues(const HashSet<T, U, V>& collection){fastDeleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl);}template<typename T, typename U, typename V, typename W>inline void copyToVector(const HashSet<T, U, V>& collection, W& vector){typedef typename HashSet<T, U, V>::const_iterator iterator;vector.resize(collection.size());iterator it = collection.begin();iterator end = collection.end();for (unsigned i = 0; it != end; ++it, ++i)vector[i] = *it;}  } // namespace WTFusing WTF::HashSet;#endif /* WTF_HashSet_h */

头文件AllocationSpace.h如下地方

typedef HashSet<MarkedBlock*>::iterator BlockIterator;

修改为

typedef HashSet<MarkedBlock*>::const_iterator BlockIterator;

头文件ShadowInclusionSelector.h如下地方

inline ShadowInclusion* ShadowInclusionSet::find(Node* key) const
{PointerSet::iterator found = m_set.find<Node*, ShadowInclusionSet::Translator>(key);return found != m_set.end() ? *found : 0;
}

修改为

inline ShadowInclusion* ShadowInclusionSet::find(Node* key) const
{auto found = m_set.find<Node*, ShadowInclusionSet::Translator>(key);return found != m_set.end() ? *found : 0;
}

源文件JSParser.cpp如下地方

        void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector<RefPtr<StringImpl> >& vector){IdentifierSet::iterator end = capturedVariables.end();for (IdentifierSet::iterator it = capturedVariables.begin(); it != end; ++it) {if (m_declaredVariables.contains(*it))continue;vector.append(*it);}vector.shrinkToFit();}

修改为

        void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector<RefPtr<StringImpl> >& vector){<span style="white-space:pre">  </span>auto end = (capturedVariables.end());for (auto it = (capturedVariables.begin()); it != end; ++it) {<span style="white-space:pre">    </span>if (m_declaredVariables.contains(*it))<span style="white-space:pre">      </span>continue;<span style="white-space:pre">       </span>vector.append(*it);}vector.shrinkToFit();}

其他HashSet模板的迭代器和const迭代器错误修改就不再列举。如上替换即可。

另外MathExtras.h里面还有一些函数有重定义,在MathExtras.h添加math.h,使用_INC_MATH宏添加判断即可。

至此,vs2013即可编译通过。

wke升级vs2010,vs2013相关推荐

  1. 把项目从VS2005升级到VS2013

    小斯同学花了几周的时间,终于把我们的服务端和客户端从vs2005升级到vs2013了.真是不得不给个赞. 升级的过程中遇到了各种问题,小斯同学跋山涉水.越过艰难险阻终于成功让我们用上了高大上的宇宙第一 ...

  2. Windows Embedded Compact 2013升级:VS2013也能编译

    IT之家(www.ithome.com):Windows Embedded Compact 2013升级:VS2013也能编译 今天,微软为Windows Embedded Compact 2013送 ...

  3. 【流媒體】live555—VS2010/VS2013 下live555编译、使用及测试

    [流媒體]live555-VS2010 /VS2013 下live555编译.使用及测试 SkySeraph Apr 11st 2012 Email:skyseraph00@163.com 更多精彩请 ...

  4. Windows开发环境搭建(安装 VS2010, VS2013, VS2015 Community, Windows Server 2008 R2)

    1. 安装VS2010 1.1 安装步骤 1. 注意安装的时候,选择自定义安装,将不需要的VB.net去掉. 2. 看一下C++下的x64选项是否选择了,如果没选,将其选上. 3. 一定要将 Micr ...

  5. 多媒体开发之--- live555 vs2010/vs2013下编译,使用,测试

    Ⅰ live555简介 Live555 是一个为流媒体提供解决方案的跨平台的C++开源项目,它实现了对标准流媒体传输协议如RTP/RTCP.RTSP.SIP等的支持.Live555实现了对多种音视频编 ...

  6. VS2003升级VS2010修改

    BUG1: fatal error C1189: #error: MFC does not support WINVER less than 0x0601. Ple 在StdAfx.h中把#defin ...

  7. Sandcastle Help File Builder(.NET帮助文档工具)的版本选择心得——支持VS2010至VS2015,高版本项目文件问题...

    作者: zyl910 一.缘由 "Sandcastle Help File Builder"(简称SHFB)是一个很好用.NET 帮助文档生成工具. 但它的每个版本支持的VS版本范 ...

  8. Intel TBB简介及在Windows7 VS2013上源码的编译过程

    Intel TBB(Intel Threading Building Blocks)是Intel线程构建块开源库,它的License是Apache 2.0. Intel TBB是一种用于并行编程的基于 ...

  9. Windows7上使用VS2013编译Caffe源码(不带GPU支持)步骤

    1.      从https://github.com/BVLC/caffe/通过git clone下载caffe源码,master分支,版本号为09868ac:$ git  clone https: ...

  10. VS2013和VS2015中MVC 区域路由匹配顺序相反

    创建测试工程 分别在vs2013和vs2015中创建mvc项目,并创建First.Second.Three三个Area,每个Area下面创建一个HomeController和Index视图.修改Rou ...

最新文章

  1. keras 的 example 文件 cifar10_resnet.py 解析
  2. c++ 构造函数析构函数 数据安全_C++知识点 16:构造函数和析构函数的语法
  3. Apple导出p12证书 导出证书为p12 Apple开发
  4. IDEA JNI配置
  5. HSC86H SUMTOR 混合步进伺服电机驱动器
  6. mysql联合索引查找过程_(MYSQL)回表查询原理,利用联合索引实现索引覆盖
  7. hive连接mysql的配置_Dbeaver连接Hive和Mysql的配置
  8. 自定义SpringBoot项目的Maven原型
  9. .NET Core 3.0之深入源码理解ObjectPool(一)
  10. 神话人物的现代版简历
  11. 2022年有哪些值得学习的Java开源项目?这7个火爆了
  12. GMA Round 1 极坐标的忧伤
  13. LeetCode(788)——旋转数字(JavaScript)
  14. 把合数分解成若干个质因数相成
  15. 1.2创建简单的应用
  16. Jsoup——抖音视频抓取(二)
  17. 我的图床解决方案,超详细!
  18. 《调色师手册:电影和视频调色专业技法(第2版)》——往返工作流程(Round-Trip workflows)...
  19. C和C++哪个更快?
  20. 强调实体融合的当下,元宇宙当仁不让地成为各色玩家关注的焦点

热门文章

  1. 私塾在线《研磨设计模式》,精品课程上线特大惊喜
  2. AAAI 2020上的NLP有哪些研究风向?
  3. VC++黑客编程收集的源码集合,只有你想不到的
  4. C语言实现密码字典生成器
  5. 服务器dell/hp/ibm硬件检测工具
  6. 360和腾讯QQ的那场战争!
  7. 1-一、安装NVIDIA控制面板
  8. SQLServer2016安装教程
  9. Maya2014/2015/2016/2017/2018/2019安装包及安装教程
  10. Python入门书 - 简明Python教程(A Byte of Python)