Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't use std::thread with CDT and MinGW
Can't use std::thread with CDT and MinGW [message #778436] Thu, 12 January 2012 08:13 Go to next message
Eclipse UserFriend
I am wanting to use std::thread with my Eclipse Indigo and MinGW (gcc 4.6.2)
combination on Windows 7 but it reports that thread is not a member of std.
I have included <thread> but what else do I need to do to have std::thread
as a
usable class?

--
Regards,

Jarrick
Re: Can't use std::thread with CDT and MinGW [message #778551 is a reply to message #778436] Fri, 13 January 2012 08:33 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
A quick search in this forum Mad

http://www.eclipse.org/forums/index.php/m/775651/?srch=std%3A%3Athread#msg_775651


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Can't use std::thread with CDT and MinGW [message #778554 is a reply to message #778551] Fri, 13 January 2012 09:02 Go to previous messageGo to next message
Eclipse UserFriend
"Axel Mueller" wrote in message news:jeoq89$64k$1@news.eclipse.org...

> A quick search in this forum :x
> http://www.eclipse.org/forums/index.php/m/775651/?srch=std%3A%3Athread#msg_775651

Thanks but it's a pity that your link points back to another of my own posts
on the subject.

Someone else has pointed out how to define the symbol in my original
question but the class std::thread is still not visible because of other
symbols not being defined. I have posted about this 3 times now and the
first two times I requested help in having that original symbol defined. In
my most recent post I did not refer to that symbol anymore because I now
know how to define it; the problem is simply that I still cannot use
std::thread.

So, does anyone know how I can use std::thread? The other symbols which are
not defined probably mean that other dependencies are not met in this
configuration so I really need to hear from someone who has either managed
to use this class or can explain why I cannot use it.

--
Regards,

Jarrick
Re: Can't use std::thread with CDT and MinGW [message #778570 is a reply to message #778554] Fri, 13 January 2012 10:09 Go to previous messageGo to next message
Rob Lorimer is currently offline Rob LorimerFriend
Messages: 3
Registered: January 2012
Junior Member
I responded to one of your original posts stating that you should include support for c++0x (c++11) by using the -std=gnu++0x flag.

You should do this in two places i.e. once for discovery (my previous answer) so that eclipse codan works correctly and second for the compiler flags so the compiler will work.

It's all down to using -std==gnu++0x as std::thread is part of the newer c++ features. Inclusion of this flag creates the symbols that you need rather than entering the symbols manually (as you'll likely miss some).
Re: Can't use std::thread with CDT and MinGW [message #778576 is a reply to message #778570] Fri, 13 January 2012 10:29 Go to previous messageGo to next message
Eclipse UserFriend
"Rob Lorimer" wrote in message news:jeovsj$h5d$1@news.eclipse.org...

> I responded to one of your original posts stating that you should include
> support for c++0x (c++11) by using the -std=gnu++0x flag.
>
> You should do this in two places i.e. once for discovery (my previous
> answer)
> so that eclipse codan works correctly and second for the compiler flags so
> the compiler will work.
> It's all down to using -std==gnu++0x as std::thread is part of the newer
> c++
> features. Inclusion of this flag creates the symbols that you need rather
> than
> entering the symbols manually (as you'll likely miss some).

Thanks Rob but I must be missing something as it still doesn't work.

I have added that flag to Discovery Options->Compiler invocation arguments
and also to Settings->GCC C++ Compiler->Miscellaneous->Other flags as well
as rebuilding the index and rebuilding the project but any reference to
std::thread is still in red and I get this compiler error:

'thread' is not a member of 'std'

Are you sure you are able to actually use std::thread with this flag and/or
is there something else that I am supposed to be doing?

--
Regards,

Jarrick
Re: Can't use std::thread with CDT and MinGW [message #778587 is a reply to message #778576] Fri, 13 January 2012 12:29 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
It seems that MinGW does not support C++11 very well.
http://stackoverflow.com/questions/5930826/how-to-enable-experimental-c11-concurrency-features-in-mingw

See also http://www.eclipse.org/forums/index.php/t/272462/


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:How can I export the ASM code ?
Next Topic:stringstream data type causing memory violations
Goto Forum:
  


Current Time: Fri Apr 26 14:01:44 GMT 2024

Powered by FUDForum. Page generated in 0.02686 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top