locked
Cannot open include file: 'regex' RRS feed

  • Question

  • Hi,all, I tried

    #include <regex>
    

    but got the following error:

    fatal error C1083: Cannot open include file: 'regex': No such file or directory
    

    i thought visual studio 2008 should have included this TR1 package in their sp1 release. whats going on? thanks

    daiyue

    Tuesday, October 19, 2010 8:31 PM

Answers

  • 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.

    • Marked as answer by daiyueweng Tuesday, October 19, 2010 10:36 PM
    Tuesday, October 19, 2010 8:35 PM
  • Microsoft Update is different from Windows Update, which only update Windows, not updating other Microsoft programs like Microsoft Update does. Visit update.microsoft.com instead.

    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.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by daiyueweng Tuesday, October 19, 2010 10:36 PM
    Tuesday, October 19, 2010 9:33 PM

All replies

  • 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.

    • Marked as answer by daiyueweng Tuesday, October 19, 2010 10:36 PM
    Tuesday, October 19, 2010 8:35 PM
  • 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.


    how to check it is sp1 installed, i checked the "About", and got the following info: 

    Microsoft Visual Studio 2008
    Version 9.0.21022.8 RTM
    Microsoft .NET Framework
    Version 3.5 SP1

    how to repair the installation? thanks

    daiyue

    Tuesday, October 19, 2010 8:49 PM
  • > Version 9.0.21022.8 RTM

    That's the RTM edition. Download SP1 from Microsoft's download center and install, or visit Microsoft Update.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Tuesday, October 19, 2010 9:10 PM
  • Are you compiling for CE/Mobile?  The Windows CE stuff doesn't have support for regex.  The boost stuff can be made to work though.
    Tuesday, October 19, 2010 9:10 PM
  • > Version 9.0.21022.8 RTM

    That's the RTM edition. Download SP1 from Microsoft's download center and install, or visit Microsoft Update.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP

    i tried the windows update, and it didnt tell me there is a sp1 package available, and whats the difference between RTM and normal visual studio edition?
    Tuesday, October 19, 2010 9:23 PM
  • Microsoft Update is different from Windows Update, which only update Windows, not updating other Microsoft programs like Microsoft Update does. Visit update.microsoft.com instead.

    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.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    • Marked as answer by daiyueweng Tuesday, October 19, 2010 10:36 PM
    Tuesday, October 19, 2010 9:33 PM
  • Microsoft Update is different from Windows Update, which only update Windows, not updating other Microsoft programs like Microsoft Update does. Visit update.microsoft.com instead.

    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.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP


    yea, I tried to install the sp1 and the version number increased, and "regex" is in there.

    ps. windows update and microsoft update are the same thing in Windows, I download the sp1 installer from

    http://www.microsoft.com/downloads/en/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

    thanks for the help

    daiyue

    Tuesday, October 19, 2010 10:36 PM