Use the new features of VC 10.0 in earlier versions of VC

Source: Internet
Author: User
Tags vc9

 

 
/*! New features created by: Andrew. Wu (erpingwu@gmail.com) using VC 10.0 in earlier versions of VC)
Http://blog.oow.age.com/erpingwu/in non-rush hours -vs-ide-use the new features of -vc-100/






*/

VC 10.0 provides some new features, the most striking of which is lambda. However, the large amount of vs2010 beta memory usage has to be dispelled.
Master 7cat pointed out that "vc ide is just a shell"
What if we use the new features of the VC 10.0 compiler?
Take vc9 as an example. Note that tools-> projects and solutions-> VC ++ directories-> executable files-> $ (vcinstalldir) Bin describes the cl.exe, link.exe, and other tools used by ide.com. add $ (vcinstalldir) bin_vc10.0 in front of this directory to copy the required vc10.0 file.

C1.dll
C1xx. dll
C2.dll
Cl.exe
Cl.exe. config
Link.exe
Link.exe. config
Msobj100.dll
Mspdb100.dll
Mspdbcore. dll
Mspdbsrv.exe
Msvcm100.dll
Msvcp100.dll
Msvcr100.dll

Find an example and try it. Then you will find that C ++ 0x Lambda is ready for use.ProgramThe DLL used is still vc9.

 # include " stdafx. h  "# include 
  
    # include 
    string  
    using  
    namespace  STD; 
    int  _ tmain (
    int  argc, _ tchar * argv []) {[] (
    const  
    string  & Str) {cout 
   
     Hello VC 10.0 ") ;}
   
  

MS's statement of VC10 is "10 is the new 6", which is only reflected in one place, not speed, not ide memory usage, it is manifested in the final release of the program. Amen, VC 10.0 can be released through xcopy again, without having to work hard on manifest to handle various hack formats.
however, even if you use link.exe of VC 10.0, you still cannot get rid of the dilemma of vc9. At this time, there is a more exaggerated practice: not only use the compilation and Connection Tool of VC 10.0, but also its library.
you only need to add the directory corresponding to VC 10.0 in tools> projects and solutions> VC ++ directories-> include files and library files (note that the directory must be earlier than the original directory of vc9)
after rebuilding the project, you will find that you can copy the program and the required VC 10.0 DLL directly to a machine without the VC 10.0 Runtime Library.
the above steps are also in passed the test in VC 7.1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.