visual-c++-2010

lambda expression (MSVC++ vs g++)

…衆ロ難τιáo~ 提交于 2019-12-08 21:50:53
问题 I have the following code #include <algorithm> #include <iostream> #include <vector> #include <functional> int main() { typedef std::vector<int> Vector; int sum=0; Vector v; for(int i=1;i<=10;++i) v.push_back(i); std::tr1::function<double()> l=[&]()->double{ std::for_each(v.begin(),v.end(),[&](int n){sum += n; //Error Here in MSVC++}); return sum; }; std::cout<<l(); std::cin.get(); } The above code produces an error on MSVC++ 10 whereas it compiles fine with g++ 4.5 . The error produced is 1

Visual C++ 2010 error. The system cannot find the file specified

天大地大妈咪最大 提交于 2019-12-08 04:50:50
问题 I am trying to run a sample tutorial on Visual C++ 2010 but it keeps giving me this error: Unable to start program C:\Users\SVS\Documents\Visual Studio 2010\Projects\3DTrialOne\Debug\3DTrialOne.exe The system cannot find the file specified. I have created a new project and added the source code into the new one. I have created a new project from existing code too. It still has the same error. Should I change anything in the configuration settings? I have tried to point the working path in the

How to open vcxproj (visual c++ project) with visual studio 2008

自作多情 提交于 2019-12-08 03:04:01
问题 does anybody know how to open vcxproj in visual studio 2008. It seems this file was only opened by visual studio 2010 isn't it? 回答1: You don't. You'll need to create a Visual C++ 2008 project (.vcproj). Visual C++ 2008 uses VCBuild; Visual C++ 2010 uses MSBuild. 来源: https://stackoverflow.com/questions/4621978/how-to-open-vcxproj-visual-c-project-with-visual-studio-2008

std::make_shared as a default argument does not compile

人盡茶涼 提交于 2019-12-07 10:59:02
问题 In Visual C++ (2008 and 2010), the following code does not compile with the following error: #include <memory> void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) ) { } class P { void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) ) { } }; error C2039: 'make_shared' : is not a member of '`global namespace'' error C3861: 'make_shared': identifier not found It is complaining about the definition of P::Foo() not ::Foo(). Does anybody know why it is valid for

How do I use iFileDialog in a VC++ 2010 project converted from VC++ 6.0?

若如初见. 提交于 2019-12-07 04:46:32
问题 I am able to use a FileSaveDialog (Common Item Dialog) in a VC++ 2010 app like this: IFileDialog *pFileDialog; HRESULT hr = CoCreateInstance(CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pFileDialog)); but when I put this code into my project that has been converted from VC++ 6.0 to VC++ 2010 I get the following error: "error C2787: 'IFileDialog' : no GUID has been associated with this object" I also get a red squiggle under the IID_PPV_ARGS macro and the float-over error:

How to open vcxproj (visual c++ project) with visual studio 2008

强颜欢笑 提交于 2019-12-06 13:36:34
does anybody know how to open vcxproj in visual studio 2008. It seems this file was only opened by visual studio 2010 isn't it? You don't. You'll need to create a Visual C++ 2008 project (.vcproj). Visual C++ 2008 uses VCBuild; Visual C++ 2010 uses MSBuild. 来源: https://stackoverflow.com/questions/4621978/how-to-open-vcxproj-visual-c-project-with-visual-studio-2008

How can an Empty Visual C++ project be created programmatically?

半城伤御伤魂 提交于 2019-12-06 06:42:19
I wanted to know how to use the template for an Empty Visual C++ project to programmatically create a new solution with this empty project. The code (C#) I have right now is: string VSProgID = "VisualStudio.Solution.10.0"; Type solnObjType = System.Type.GetTypeFromProgID(VSProgID, true); Solution4 soln = (Solution4) System.Activator.CreateInstance(solnObjType, true); soln.Create(@"C:\NewSoln", "New"); soln.SaveAs(@"C:\NewSoln\New.sln"); string emptyVCProjPath = soln.GetProjectTemplate("General/Empty Project", "VC++"); // Here's where I need help soln.AddFromTemplate(emptyVCProjPath, @"C:

TR1 regex: capture groups?

拜拜、爱过 提交于 2019-12-05 22:20:51
I am using TR1 Regular Expressions (for VS2010) and what I'm trying to do is search for specific pattern for a group called "name", and another pattern for a group called "value". I think what I want is called a capture group , but I'm not sure if that's the right terminology. I want to assign matches to the pattern "[^:\r\n]+):\s" to a list of matches called "name", and matches of the pattern "[^\r\n]+)\r\n)+" to a list of matches called "value". The regex pattern I have so far is string pattern = "((?<name>[^:\r\n]+):\s(?<value>[^\r\n]+)\r\n)+"; But the regex T4R1 header keeps throwing an

MSVC fails with compiler errors without compiling any sources

。_饼干妹妹 提交于 2019-12-05 21:21:46
All source files seem to have compiled fine. However, since I achieved that, I am getting a new compiler error: 1>------ Erstellen gestartet: Projekt: OpenLieroX, Konfiguration: Debug Win32 ------ 1>Der Buildvorgang wurde am 29.03.2012 23:57:39 gestartet. 1>InitializeBuildStatus: 1> Aktualisieren des Timestamps von "Debug\OpenLieroX.unsuccessfulbuild". 1>ClCompile: 1> Alle Ausgaben sind aktuell. 1> Alle Ausgaben sind aktuell. 1> Alle Ausgaben sind aktuell. 1> Alle Ausgaben sind aktuell. 1> Alle Ausgaben sind aktuell. 1> Alle Ausgaben sind aktuell. 1> Alle Ausgaben sind aktuell. 1> Alle

std::make_shared as a default argument does not compile

筅森魡賤 提交于 2019-12-05 17:44:24
In Visual C++ (2008 and 2010), the following code does not compile with the following error: #include <memory> void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) ) { } class P { void Foo( std::shared_ptr< int > test = ::std::make_shared< int >( 5 ) ) { } }; error C2039: 'make_shared' : is not a member of '`global namespace'' error C3861: 'make_shared': identifier not found It is complaining about the definition of P::Foo() not ::Foo(). Does anybody know why it is valid for Foo() to have a default argument with std::make_shared but not P::Foo()? It looks like a bug in the