Unable to get std::thread working

View: New views
3 Messages — Rating Filter:   Alert me  

Unable to get std::thread working

by Troy Heron :: Rate this Message:

| View Threaded | Show Only this Message

I compiled the gcc 4.4.0 release from source and upon trying execute a simple hello world program that uses std::thread I get the following error:

./t: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./t)

All non c++0x aspects of gcc/stdc++ seem to work fine.

I'm sure I've likely done something silly when compiling/installing gcc...  any ideas?

Thanks
Troy Heron

Parent Message unknown Re: Unable to get std::thread working

by spam.spam.spam.spam :: Rate this Message:

| View Threaded | Show Only this Message

Selon Troy Heron <troy.heron@...>:

>
> I compiled the gcc 4.4.0 release from source and upon trying execute a simple
> hello world program that uses std::thread I get the following error:
>
> ./t: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required
> by ./t)
>
> All non c++0x aspects of gcc/stdc++ seem to work fine.
>
> I'm sure I've likely done something silly when compiling/installing gcc...
> any ideas?
>
> Thanks
> Troy Heron
>
> --
> View this message in context:
>
http://www.nabble.com/Unable-to-get-std%3A%3Athread-working-tp23720627p23720627.html
> Sent from the gcc - Help mailing list archive at Nabble.com.
>
>

I have just installed gcc-4.4.0 and I got the libstdc++ library.

Try to do this :
./configure --disable-bootstrap --enable-languages=c++
make
make install

Re: Unable to get std::thread working

by Ian Lance Taylor-3 :: Rate this Message:

| View Threaded | Show Only this Message

Troy Heron <troy.heron@...> writes:

> I compiled the gcc 4.4.0 release from source and upon trying execute a simple
> hello world program that uses std::thread I get the following error:
>
> ./t: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required
> by ./t)
>
> All non c++0x aspects of gcc/stdc++ seem to work fine.
>
> I'm sure I've likely done something silly when compiling/installing gcc...
> any ideas?

Most likely your program t is using the libstdc++.so which comes with
the system rather than the libstdc++.so which is part of your newly
installed gcc.  This can happen if you configured gcc with a --prefix
option.  The simple fix will be to set the LD_LIBRARY_PATH environment
variable to point to the directory holding your libstdc++.so.

Ian