在VS2008中使用#include <regex>,会得到以下错误提示:

fatal error C1083: Cannot open include file: 'regex': No such file or directory 
然后google关键字:“Cannot open include file: 'regex': No such file or directory”,可以找到下面这个link:
“Cannot open include file: 'regex'” 
可以得到相关解答 为:
[1] 
Yes, VC++ 2010 and 2008 SP1 include the TR1 regex library. If you have SP1 installed, but don't have that header, I recommend repairing your Visual Studio installation. 
If using a third-party library is an option, I recommend boost's xpressive or regex libraries, the latter of which was the basis for TR1's regex.
[2]
RTM stands for release to manufacturing, which is the originally released version (without service packs). If you installed the service pack you will have a higher version number in Help->About.
[3]
yea, I tried to install the sp1 and the version number increased, and "regex" is in there.
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

然后查看一下本机上安装的VS2008,版本号如下:
Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5 SP1
因此,在RTM版本上并没有service packs,所以才找不到'regex'。
通过上面的回答,可以找到“Microsoft Visual Studio 2008 Service Pack 1 (Installer)   (VS90sp1-KB945140-ENU.exe 536KB) ”,下载安装发现出错,提示这个更新只支持E版的VS2008:
Installation Requirements:
A compatible version of Visual Studio 2008 was not detected on the system. This update is designed for only the Microsoft Visual Studio 2008 (ENU) product family, and is not compatible with any Express editions.

要删除中文版的再装英文版的比较繁琐,因此继续寻找其他的解决办法。

遇到的问题,说明当前安装的VS2008没有包含regex,在MSDN ( http://msdn.microsoft.com/en-us/ms348103.aspx )上搜索关键字“regex” ,可以搜到一篇名为“<regex>”的文档。然后可以得到关键字“TR1 Regular Expressions”,然后可以进一步找到一下文档等等。
“Standard C++ Library TR1 Extensions Reference”
“TR1 Regular Expressions”
“Quick Start for C++ TR1 Regular Expressions - CodeProject  ”

在“Standard C++ Library TR1 Extensions Reference ”一文中,可以找到以下的提示:
If you start hitting linker errors with this code (even though the includes appear to be present), ensure you download the Visual C++ 2008 Feature Pack Release to get it.
This page should really link to it - http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en

通过上面的提示,可以找到“Visual C++ 2008 Feature Pack Release ”,根据介绍可知,这个Visual C++ 2008功能包 扩展了VS2008的功能,通过使用这个扩展,MFC程序可以具有更强大的功能。This feature pack also includes an implementation of TR1 . 这就是我们要找的。
在“Standard C++ Library TR1 Extensions Reference”一文中得知:
This reference describes the Visual C++ implementation of the proposed extensions of the C++ ISO standard that are included in the draft document, "Technical Report 1 ." The Visual C++ implementation includes support for fixed-size arrays, function objects, hash tables, regular expressions, template metaprogramming, template types for aggregating related objects, and random-number generation.

在“系统要求”一栏中,说明这个功能包仅支持英文系统版本的VS2008,但是下句又说明,对于非英语版本的也可以使用 :
Support for systems with non-English versions of Visual Studio 2008 installed will be available in Visual Studio 2008 Service Pack 1.

然后在MSDN上搜索关键字“Visual Studio 2008 Service Pack 1 ”,可以找到以下文档:
Microsoft Visual Studio 2008 Service Pack 1 (Installer)   (VS90sp1-KB945140-ENU.exe 536KB) ”—— 上文尝试过,这个只能使用于E版的VS2008
Microsoft Visual Studio 2008 Service Pack 1 (iso)   (VS2008SP1ENUX1512962.iso 831.3MB) ”—— 未尝试
可以发现,这两个“Visual Studio 2008 Service Pack 1”除了文件大小不同,其余介绍都一样,下载和安装比较费时,但欣慰的是安装成功了。再次查看VS的版本号,发现版本号比安装前的提高了。
Version 9.0.21022.8 RTM => 9.0.30729.1 sp
对于上面的测试代码不再提示未找到regex的错误提示。下来的工作是做进一步的测试和使用。

参考: 
[1] Standard C++ Library TR1 Extensions Reference   (标准C++库TR1的扩展参考)
http://msdn.microsoft.com/en-us/library/bb982198%28v=VS.90%29.aspx 
[2] TR1 Regular Expressions
http://msdn.microsoft.com/en-us/library/bb982727%28v=VS.90%29.aspx 
[3] Cannot open include file: 'regex'
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/fc2e32b5-e55f-416f-8c74-c018d0f793ab/ 
[4] MSDN Library for Visual Studio 2008 SP1 
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7bbe5eda-5062-4ebb-83c7-d3c5ff92a373&DisplayLang=en 
[5] Quick Start for C++ TR1 Regular Expressions
http://www.codeproject.com/KB/string/TR1Regex.aspx 
[6] Visual C++ 2008 Feature Pack安装失败
http://zhanyonhu.blog.163.com/blog/static/1618604420094142334417/ 
[7] vc2008中MFC重大变革-Visual C++ 2008 Feature Pack Beta 发布(附图) 
http://www.cppblog.com/woaidongmao/archive/2009/06/19/88092.aspx 
[8] Visual C++ 2008 Feature Pack 体验 
http://www.cnblogs.com/arowana/archive/2008/01/19/1045244.html

附:“ Visual C++ 2008 Feature Pack Release”说明

安装
Visual C++ 2008 Feature Pack Release    (VC2008FeaturePack.exe 322.9MB)

Overview 
The Visual C++ 2008 Feature Pack extends the VC++ Libraries shipped with Visual Studio 2008 and is fully covered under Microsoft's standard support policies.
The VC++ 2008 MFC libraries have been extended to support creation of applications that have:
    * Office Ribbon style interface
    * Office 2007, Office 2003 and Office XP look and feel
    * Modern Visual Studio-style docking toolbars and panes
    * Fully customizable toolbars and menus
    * A rich set of advanced GUI controls
    * Advanced MDI tabs and groups
    * And much more!
This feature pack also includes an implementation of TR1 . Portions of TR1 are scheduled for adoption in the upcoming C++0x standard as the first major addition to the ISO 2003 standard C++ library.Our implementation includes a number of important features such as:
    * Smart pointers
    * Regular expression parsing
    * New containers (tuple, array, unordered set, etc)
    * Sophisticated random number generators
    * Polymorphic function wrappers
    * Type traits
    * And more!
Note: This feature pack does not include C99 compatibility or support for special math functions.

System Requirements 
    * Supported Operating Systems:Windows Server 2003;Windows Vista;Windows XP
    * Visual Studio: This Feature Pack is only supported on systems which have the English language (ENU) version of Visual Studio 2008 Standard Edition or above installed.
          o Support for systems with non-English versions of Visual Studio 2008 installed will be available in Visual Studio 2008 Service Pack 1 .
    * Microsoft Windows SDK: If you install the Visual C++ 2008 Feature Pack and then install the Windows SDK for Windows Server 2008 and .NET Framework 3.5, some of the files in the Feature Pack are overwritten and lose the additions made by the Feature Pack.
      Resolution:
          o Please install the Windows SDK for Windows Server 2008 and .NET Framework 3.5 first and then the Feature Pack.
          o If you have already installed the Feature Pack first and then Windows SDK, repairing your VS 2008 installation should solve the problem.

Instructions 
MSDN online Libraries
The MSDN online libraries have been updated with new documentation and walkthroughs that support the new MFC and TR1 features included in this release. The documentation provides some great content to get you up and running quickly with the new components. The documentation can be found at:
    * MFC http://msdn2.microsoft.com/en-us/library/bb982354.aspx 
    * TR1 http://msdn2.microsoft.com/en-us/library/bb982198.aspx

Additional Information 
VC Redist Package
The VCRedist_x86.exe package has been updated with this refresh to resolve previous installation and deployment blocking issues.

在VS2008中使用#include <regex>,会得到以下错误提示:
fatal error C1083: Cannot open include file: 'regex': No such file or directory 
然后google关键字:“Cannot open include file: 'regex': No such file or directory”,可以找到下面这个link:
“Cannot open include file: 'regex'” 
可以得到相关解答 为:
[1] 
Yes, VC++ 2010 and 2008 SP1 include the TR1 regex library. If you have SP1 installed, but don't have that header, I recommend repairing your Visual Studio installation. 
If using a third-party library is an option, I recommend boost's xpressive or regex libraries, the latter of which was the basis for TR1's regex.
[2]
RTM stands for release to manufacturing, which is the originally released version (without service packs). If you installed the service pack you will have a higher version number in Help->About.
[3]
yea, I tried to install the sp1 and the version number increased, and "regex" is in there.
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

然后查看一下本机上安装的VS2008,版本号如下:
Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5 SP1
因此,在RTM版本上并没有service packs,所以才找不到'regex'。
通过上面的回答,可以找到“Microsoft Visual Studio 2008 Service Pack 1 (Installer)   (VS90sp1-KB945140-ENU.exe 536KB) ”,下载安装发现出错,提示这个更新只支持E版的VS2008:
Installation Requirements:
A compatible version of Visual Studio 2008 was not detected on the system. This update is designed for only the Microsoft Visual Studio 2008 (ENU) product family, and is not compatible with any Express editions.

要删除中文版的再装英文版的比较繁琐,因此继续寻找其他的解决办法。

遇到的问题,说明当前安装的VS2008没有包含regex,在MSDN ( http://msdn.microsoft.com/en-us/ms348103.aspx )上搜索关键字“regex” ,可以搜到一篇名为“<regex>”的文档。然后可以得到关键字“TR1 Regular Expressions”,然后可以进一步找到一下文档等等。
“Standard C++ Library TR1 Extensions Reference”
“TR1 Regular Expressions”
“Quick Start for C++ TR1 Regular Expressions - CodeProject  ”

在“Standard C++ Library TR1 Extensions Reference ”一文中,可以找到以下的提示:
If you start hitting linker errors with this code (even though the includes appear to be present), ensure you download the Visual C++ 2008 Feature Pack Release to get it.
This page should really link to it - http://www.microsoft.com/downloads/details.aspx?FamilyId=D466226B-8DAB-445F-A7B4-448B326C48E7&displaylang=en

通过上面的提示,可以找到“Visual C++ 2008 Feature Pack Release ”,根据介绍可知,这个Visual C++ 2008功能包 扩展了VS2008的功能,通过使用这个扩展,MFC程序可以具有更强大的功能。This feature pack also includes an implementation of TR1 . 这就是我们要找的。
在“Standard C++ Library TR1 Extensions Reference”一文中得知:
This reference describes the Visual C++ implementation of the proposed extensions of the C++ ISO standard that are included in the draft document, "Technical Report 1 ." The Visual C++ implementation includes support for fixed-size arrays, function objects, hash tables, regular expressions, template metaprogramming, template types for aggregating related objects, and random-number generation.

在“系统要求”一栏中,说明这个功能包仅支持英文系统版本的VS2008,但是下句又说明,对于非英语版本的也可以使用 :
Support for systems with non-English versions of Visual Studio 2008 installed will be available in Visual Studio 2008 Service Pack 1.

然后在MSDN上搜索关键字“Visual Studio 2008 Service Pack 1 ”,可以找到以下文档:
Microsoft Visual Studio 2008 Service Pack 1 (Installer)   (VS90sp1-KB945140-ENU.exe 536KB) ”—— 上文尝试过,这个只能使用于E版的VS2008
Microsoft Visual Studio 2008 Service Pack 1 (iso)   (VS2008SP1ENUX1512962.iso 831.3MB) ”—— 未尝试
可以发现,这两个“Visual Studio 2008 Service Pack 1”除了文件大小不同,其余介绍都一样,下载和安装比较费时,但欣慰的是安装成功了。再次查看VS的版本号,发现版本号比安装前的提高了。
Version 9.0.21022.8 RTM => 9.0.30729.1 sp
对于上面的测试代码不再提示未找到regex的错误提示。下来的工作是做进一步的测试和使用。

参考: 
[1] Standard C++ Library TR1 Extensions Reference   (标准C++库TR1的扩展参考)
http://msdn.microsoft.com/en-us/library/bb982198%28v=VS.90%29.aspx 
[2] TR1 Regular Expressions
http://msdn.microsoft.com/en-us/library/bb982727%28v=VS.90%29.aspx 
[3] Cannot open include file: 'regex'
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/fc2e32b5-e55f-416f-8c74-c018d0f793ab/ 
[4] MSDN Library for Visual Studio 2008 SP1 
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7bbe5eda-5062-4ebb-83c7-d3c5ff92a373&DisplayLang=en 
[5] Quick Start for C++ TR1 Regular Expressions
http://www.codeproject.com/KB/string/TR1Regex.aspx 
[6] Visual C++ 2008 Feature Pack安装失败
http://zhanyonhu.blog.163.com/blog/static/1618604420094142334417/ 
[7] vc2008中MFC重大变革-Visual C++ 2008 Feature Pack Beta 发布(附图) 
http://www.cppblog.com/woaidongmao/archive/2009/06/19/88092.aspx 
[8] Visual C++ 2008 Feature Pack 体验 
http://www.cnblogs.com/arowana/archive/2008/01/19/1045244.html

附:“ Visual C++ 2008 Feature Pack Release”说明

安装
Visual C++ 2008 Feature Pack Release    (VC2008FeaturePack.exe 322.9MB)

Overview 
The Visual C++ 2008 Feature Pack extends the VC++ Libraries shipped with Visual Studio 2008 and is fully covered under Microsoft's standard support policies.
The VC++ 2008 MFC libraries have been extended to support creation of applications that have:
    * Office Ribbon style interface
    * Office 2007, Office 2003 and Office XP look and feel
    * Modern Visual Studio-style docking toolbars and panes
    * Fully customizable toolbars and menus
    * A rich set of advanced GUI controls
    * Advanced MDI tabs and groups
    * And much more!
This feature pack also includes an implementation of TR1 . Portions of TR1 are scheduled for adoption in the upcoming C++0x standard as the first major addition to the ISO 2003 standard C++ library.Our implementation includes a number of important features such as:
    * Smart pointers
    * Regular expression parsing
    * New containers (tuple, array, unordered set, etc)
    * Sophisticated random number generators
    * Polymorphic function wrappers
    * Type traits
    * And more!
Note: This feature pack does not include C99 compatibility or support for special math functions.

System Requirements 
    * Supported Operating Systems:Windows Server 2003;Windows Vista;Windows XP
    * Visual Studio: This Feature Pack is only supported on systems which have the English language (ENU) version of Visual Studio 2008 Standard Edition or above installed.
          o Support for systems with non-English versions of Visual Studio 2008 installed will be available in Visual Studio 2008 Service Pack 1 .
    * Microsoft Windows SDK: If you install the Visual C++ 2008 Feature Pack and then install the Windows SDK for Windows Server 2008 and .NET Framework 3.5, some of the files in the Feature Pack are overwritten and lose the additions made by the Feature Pack.
      Resolution:
          o Please install the Windows SDK for Windows Server 2008 and .NET Framework 3.5 first and then the Feature Pack.
          o If you have already installed the Feature Pack first and then Windows SDK, repairing your VS 2008 installation should solve the problem.

Instructions 
MSDN online Libraries
The MSDN online libraries have been updated with new documentation and walkthroughs that support the new MFC and TR1 features included in this release. The documentation provides some great content to get you up and running quickly with the new components. The documentation can be found at:
    * MFC http://msdn2.microsoft.com/en-us/library/bb982354.aspx 
    * TR1 http://msdn2.microsoft.com/en-us/library/bb982198.aspx

Additional Information 
VC Redist Package
The VCRedist_x86.exe package has been updated with this refresh to resolve previous installation and deployment blocking issues.

转自:http://blog.csdn.net/delphiwcdj/article/details/6193161

解决Visual C++ 2008 Feature Pack Release安装失败的方法 —— 在VS2008简体中文版上安装TR1相关推荐

  1. VS 2008 Feature Pack界面开发学习笔记之初步接触

    作者:朱金灿 来源:http://blog.csdn.net/clever101/ 打算将最近学到的VS 2008 Feature Pack界面开发的一些心得写出来.VS 2010都出来了,我还刚用V ...

  2. Visual Studio 2008 Service Pack 1 - BETA发布

    Visual Studio 2008 SP1 提供了对Visual Studio 2008的各项改进,支持SQL Server 2008和ADO.NET的新特性Entity Framework,许多W ...

  3. 3DMAX安装失败怎样卸载重新安装3DMAX,解决3DMAX安装失败的方法总结

    3DMAX安装失败怎样卸载重新安装3DMAX,解决3DMAX安装失败的方法总结 参考文章: (1)3DMAX安装失败怎样卸载重新安装3DMAX,解决3DMAX安装失败的方法总结 (2)https:// ...

  4. win10系统安装到服务器失败怎么解决,windows10安装失败怎么办?解决win10安装失败的方法教程[多图]...

    ?自从win10 v2004正式推出之后,有许多朋友都选择将win7安装为win10系统,但是有部分朋友在安装的时候却出现了win10安装失败的情况,或者直接卡在win10安装的进程中,不知道如何解决 ...

  5. Inventor安装失败怎样卸载重新安装Inventor,解决Inventor安装失败的方法总结

    Inventor安装失败怎样卸载重新安装Inventor,解决Inventor安装失败的方法总结 参考文章: (1)Inventor安装失败怎样卸载重新安装Inventor,解决Inventor安装失 ...

  6. setuptools安装_在Ubuntu 18.04系统上安装ERPNext ERP

    简介 ERPNext是一个功能丰富的企业级ERP系统,使用Frappe框架编写,一个Python和JavaScript的Web应用程序框架,具有:会计管理.库存管理制造管理.客户关系管理系统.销售管理 ...

  7. java jdk安装失败_图文解答Java JDK9.0安装失败的原因,附带处理方法

    对于那些第一次接触Java JDK的小伙伴们来说,在安装软件时可能会遇到一些困扰,例如安装过程中断,这是为什么呢?下文就以安装Java JDK9.0为例,详细讲解软件安装失败的解决方法. Java J ...

  8. 关于Pycharm第三方安装失败问题解决方法

    关于Pycharm第三方包安装失败问题解决方法{Could not find a version that satisfies the requirement time (from versions: ...

  9. exfat安装linux系统,在CentOS 7系统上安装exFAT驱动器/启用exFAT支持的方法

    本文介绍在CentOS 7操作系统上安装exFAT驱动器的方法.exFAT(扩展文件分配表)是一种专有的Microsoft文件系统,针对闪存设备(如SD卡和USB闪存驱动器)进行了优化,它旨在取代旧的 ...

最新文章

  1. stackover flow载入巨慢
  2. 统计rgb与yuv文件中各分量的熵
  3. python下载图片 referer_Python 下载图片问题,谢谢先
  4. archlinux yaourt安装 以及出错细节 database file for archlinuxfr does not exist.
  5. 使用@JsonIdentityInfo的Spring自定义序列化器
  6. 【C语言进阶深度学习记录】二十二 指针的本质分析
  7. RNA-seq最强综述名词解释思维导图|关于RNA-seq,你想知道的都在这(续)
  8. 大佬对大佬,史诗级面试现场!!!
  9. 日期,时间相关R代码
  10. IMDB.TOP250.2020.09.BluRay.1080p.x265.10bit
  11. 物联网控制的智能LED灯带(1):WS2812灯带控制(WS2812/2811,ESP32,NODE-RED)
  12. A到Z的unicode的编码的大小
  13. FPGA和USB3.0通信-UVC摄像机
  14. ipad pro能写python吗_这是一篇用 iPad Pro 写的 iPad Pro 评测
  15. 使用 SendARP 获取 MAC 地址
  16. Docker的volumes的使用
  17. adobe cs5全线作品
  18. Python 可视化--Matplotlib 安装和pyplot
  19. HTML学习6~29(HTML语法规范)
  20. 看完全都会了!2021届毕业生还没找到Android开发工作,含BATJM大厂

热门文章

  1. windows下fortran编译器选择
  2. 基于Hadoop的疫情信息分析与可视化研究——包含大屏可视化及预测算法
  3. Linux系统selinux目录,SELinux深入理解
  4. MOSFET 安全工作区域 SOA是什么
  5. Boos直聘行业数据获取、json解析
  6. java连接数据库打印输出中文显示乱码
  7. swift 循环_Swift进行循环,切换,同时
  8. 数仓出局,中台已凉,数据湖称王!
  9. 分布式高级数据库(怀念一下我得了及格的高级数据库)
  10. 背景调查挖掘个人信息可以到什么程度?