Joseph Little
Joseph Little

Reputation: 931

How to use C++11 threading with Visual Studio

Before I start I want to explain that I am a novice and that it's highly possible that I've missed something simple or that there's something simple that I just don't know about.

Using visual studio I wanted to get a bit of threading practice in but I can't get it to include at the top of my code. I know that is new to C++11 but I'm not sure if that's enabled for Visual Studio 2010 or if it isn't I'm not sure how I would go about doing that.

Here is a screenshot of my code:

My Code

Upvotes: 4

Views: 8174

Answers (1)

Andy Prowl
Andy Prowl

Reputation: 126412

You cannot: C++11's Thread support library is not supported by the implementation of the C++ Standard Library shipped with VS2010. You should upgrade to VS2012 if you want to use it.

Alternatively, you could use Boost.Thread, which served as an inspiration for C++11's Standard Thread support library.

As a further option, you could consider purchasing the Just.Thread library, which provides a complete implementation and is available for VS2010 as well.

Upvotes: 11

Related Questions