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: Florian Weimer <fweimer at redhat dot com>
- To: net_robber <net_robber at timectrl dot net>, libstdc++ at gcc dot gnu dot org
- Date: Wed, 13 Nov 2013 12:00:01 +0100
- 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 11/13/2013 06:00 AM, net_robber wrote:
i have built toolchain(gcc 4.8.2 glibc 2.18),
the new toolchain can build most c/c++ code, but only a certain case is not work
i have a test case to re-produce the error
test.cpp:
#include <mutex>
int main(int argc, char** argv)
{
std::mutex m;
return 0;
}
Makefile:
test.out: test.cpp Makefile
${CXX} -std=c++11 -c -o $@.o lt;
${CXX} -o $@ $@.o
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;
What happens if you compile with -v? Perhaps it's picking up the wrong
version of the file from somewhere, so the search paths are of
particular interest. The preprocessed sources (-E) might provide hints
as well.
This question is probably more suited to the gcc-help mailing list.
--
Florian Weimer / Red Hat Product Security Team