New features of VC 10.0 in a lower version of VC

Source: Internet
Author: User
Tags config new features vc9

/*!
在低版本的vc中使用vc 10.0的新特性
created by : andrew.wu (erpingwu@gmail.com)
*/

VC 10.0 offers some new features, most notably lambda, but the vs2010 beta memory footprint has forced people to concede.

Master 7cat pointed out that "VC IDE is just a shell"

So what if you take advantage of the VC 10.0 compiler's new features?

Take Vc9 as an example, note tools->projects and solutions->vc++ directories->executable files->$ (VCInstallDir) Bin, This illustrates the cl.exe, Link.exe, and other tools used by the IDE. Add a $ (VCInstallDir) bin_vc10.0 to this directory before you copy the vc10.0 files you need.

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

Then find an example to try, you will find C + + 0x lambda already can be used for you, then the release of the DLL used by the program is still vc9.

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
 [](const string& str){
 cout << str << endl;
 }("Hello vc 10.0");
}

Ms's version of VC10 is "the New 6", which is reflected in only one place, not speed, not IDE memory footprint, which manifests itself in the final release of the program. Amen, VC 10.0 again can be released through Xcopy, without hard to manifest do all kinds of hack-style processing.

However, even if the VC 10.0 link.exe, still can not get rid of the plight of VC9. There is a more exaggerated approach: not only using the VC 10.0 Compilation and Connection tool, but also using its library.

Simply add the VC 10.0 corresponding directory to tools->projects and solutions->vc++ directories->include files and Library files (note that you need to vc9 the original directory Before

After rebuilding the project you will find that you can copy the program to the VC 10.0 DLL directly to the machine with no VC 10.0 runtime.

The above steps are also tested through 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.