This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: error: 'mutex' is not a member of 'std'
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: net_robber <net_robber at timectrl dot net>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 13 Nov 2013 16:10:58 +0000
- Subject: Re: error: 'mutex' is not a member of 'std'
- Authentication-results: sourceware.org; auth=none
- References: <CACdxSLm3x43OSozMjqngm_HvxmCr04MFv8TJLJFXgoWwquWnkg at mail dot gmail dot com>
On 13 November 2013 05:00, net_robber wrote:
>
> Makefile:
> test.out: test.cpp Makefile
> ${CXX} -std=c++11 -c -o $@.o lt;
> ${CXX} -o $@ $@.o
This is not the cause of your problem, but that is not the right way
to use make, you should have a separate target for the .o file, not
have two commands in a single rule.
>
> compile error like this
> test.cpp: In function 'int main(int, char**)':
> test.cpp:5:2: error: 'mutex' is not a member of 'std'
> std::mutex m;
> ^
> test.cpp:5:13: error: expected ';' before 'm'
> std::mutex m;
> ^
>
> it looks libstdc++ does NOT include mutex feature while building
It should be obvious from looking at the sources that std::mutex is
only defined conditionally:
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
...
#ifdef _GLIBCXX_HAS_GTHREADS
You need to see why one or both of those is not defined for your toolchain.