visual-c++-2012

Missing prerequisites for Visual C++ in Visual Studio 2012

删除回忆录丶 提交于 2019-11-30 14:59:27
I've recently installed vs2012 and I've updated my ClickOnce application. To be more precise, the first time I've opened my C++ project (on which depends my primary c# project) I've not updated it and everything worked fine. VS 2012 was still able to see the Visual C++ 2010 prerequisite. Later on I've updated my project by changing the Platform Toolset to "Visual Studio 2012 (v110)" under Properties->Configuration Properties->General . In the meantime I've installed even other software and now I discovered that I'm no more able to add the Visual C++ prerequisite to my project for the ClickOnce

Compile C app with Visual Studio 2012

爱⌒轻易说出口 提交于 2019-11-30 03:58:27
I plan to write application in C using Microsoft Visual Studio 2012. The problem is that I can't find a way to compile it right in the editor. I found this solution http://msdn.microsoft.com/en-us/library/bb384838.aspx but I dont like it. Can you recommend me a way to compile C program right in the Visual Studio 2012? Alexander Galkin It is a little bit tricky to compile plain C90 and C++x0 (only partially supported) projects in VS2010 (and probably Visual Studio 11, I haven't tried native development in it yet). What you have to do is to create a new C++ project without precompiled header --

Missing prerequisites for Visual C++ in Visual Studio 2012

喜欢而已 提交于 2019-11-29 20:33:15
问题 I've recently installed vs2012 and I've updated my ClickOnce application. To be more precise, the first time I've opened my C++ project (on which depends my primary c# project) I've not updated it and everything worked fine. VS 2012 was still able to see the Visual C++ 2010 prerequisite. Later on I've updated my project by changing the Platform Toolset to "Visual Studio 2012 (v110)" under Properties->Configuration Properties->General . In the meantime I've installed even other software and

fastest way to negate a number

最后都变了- 提交于 2019-11-29 06:06:27
问题 I was thinking this morning here, what would be the fastest way to reverse a number of positive to negative and from negative to positive, of course, the simplest way might be: int a = 10; a = a*(-1); or int a = 10; a = -a; But then, I thought, I take that to do this, using commands shift and pointers ... That really would be possible to change the sign of a value, using commands shift operators and memory? 回答1: The first produces: .file "optimum.c" .def ___main; .scl 2; .type 32; .endef

Can a member of a class be named the same name as its type (another class)?

元气小坏坏 提交于 2019-11-28 07:23:33
问题 Trying to compile the following code on different compilers gives me two different results: struct S{}; struct T{S S;}; int main(){} As you can see, inside T , I have an object named the same as the previously defined class S . On GCC 4.7.2, I get the following error pertaining to the S S; declaration inside T : error: declaration of 'S T::S' [-fpermissive] error: changes meaning of 'S' from 'struct S' [-fpermissive] However, moving it outside of the class (or into main ) works fine: struct S

std::thread::join() hangs if called after main() exits when using VS2012 RC

╄→尐↘猪︶ㄣ 提交于 2019-11-27 13:56:51
The following example runs successfully (i.e. doesn't hang) if compiled using Clang 3.2 or GCC 4.7 on Ubuntu 12.04, but hangs if I compile using VS11 Beta or VS2012 RC. #include <iostream> #include <string> #include <thread> #include "boost/thread/thread.hpp" void SleepFor(int ms) { std::this_thread::sleep_for(std::chrono::milliseconds(ms)); } template<typename T> class ThreadTest { public: ThreadTest() : thread_([] { SleepFor(10); }) {} ~ThreadTest() { std::cout << "About to join\t" << id() << '\n'; thread_.join(); std::cout << "Joined\t\t" << id() << '\n'; } private: std::string id() const {

Explicit Return Type of Lambda

白昼怎懂夜的黑 提交于 2019-11-27 06:56:51
When I try and compile this code (VS2010) I am getting the following error: error C3499: a lambda that has been specified to have a void return type cannot return a value void DataFile::removeComments() { string::const_iterator start, end; boost::regex expression("^\\s?#"); boost::match_results<std::string::const_iterator> what; boost::match_flag_type flags = boost::match_default; // Look for lines that either start with a hash (#) // or have nothing but white-space preceeding the hash symbol remove_if(rawLines.begin(), rawLines.end(), [&expression, &start, &end, &what, &flags](const string&

std::thread::join() hangs if called after main() exits when using VS2012 RC

て烟熏妆下的殇ゞ 提交于 2019-11-26 16:33:00
问题 The following example runs successfully (i.e. doesn't hang) if compiled using Clang 3.2 or GCC 4.7 on Ubuntu 12.04, but hangs if I compile using VS11 Beta or VS2012 RC. #include <iostream> #include <string> #include <thread> #include "boost/thread/thread.hpp" void SleepFor(int ms) { std::this_thread::sleep_for(std::chrono::milliseconds(ms)); } template<typename T> class ThreadTest { public: ThreadTest() : thread_([] { SleepFor(10); }) {} ~ThreadTest() { std::cout << "About to join\t" << id()

C++11 features in Visual Studio 2012

只谈情不闲聊 提交于 2019-11-26 12:50:43
A preview version of Visual Studio 2012 (the next version after VS2010) is now available . Does anyone know what new C++11 features it supports? (I'm not in a position to try it out at the moment). Joel Coehoorn It's worth noting that Visual Studio 2010 already had quite a bit of early C++11 support. So to summarize what is already linked to in other answers, here is what is new in Visual Studio 11 that was not part of Visual Studio 2010: rvalue references to version 2.1 from 2.0 lambdas to version 1.1 from 1.0. decltype to version 1.1 from 1.0 (not yet available in developer preview) Improved

Variadic Template in VS 2012 (Visual C++ November 2012 CTP)

梦想与她 提交于 2019-11-26 09:56:35
问题 I installed Visual C++ Compiler November 2012 CTP and created a C++ console project. I wrote this in template<typename T> void Test(T value){ } template<typename T, typename... Args> void Test(T value, Args... args){ Test(value); Test(args...); } int main(){ Test(1,2,3); } Then I pressed F6 to build in the IDE. I got this error on line 4 error C2143: syntax error : missing \',\' before \'...\' The compile list \"variadic templates\" so I believe this should work. I do understand intellisense