1

I was trying to run the test code for the future class on Windows but I had several problems. First I tried using the default compiler of Code::Blocks which in my case is MinGW 4.7.1 obtaining the error

error: variable 'std::future<bool> fut' has initializer but incomplete type|

As suggested in this question it seems that

No one has provided the necessary code to make the C++11 thread features work on Windows yet.

Since the question was from 2012 I gave it a try with more recent compilers. I had no luck using both MinGW 4.8.1 and MinGW 5.1

Surprisingly, when I tried the default compiler for Qt Creator which in my case is MinGW 4.9.1 it worked fine.

How is this possible?

Community
  • 1
  • 1
RDGuida
  • 546
  • 4
  • 15

1 Answers1

3

MinGW != MinGW

Multiple GCC-for-Windows projects exist, like MinGW, MinGW and MinGW, with different development states (last one supports the most).

Future objects are part of concurrency which got attention in GCC 4.8 and MSVC 11.

C::B uses TDM-GCC, QT Creator MinGW64 - that's the point.

Youka
  • 2,646
  • 21
  • 33