This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
error: 'mutex' is not a member of 'std'
- From: net_robber <net_robber at timectrl dot net>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 13 Nov 2013 13:00:09 +0800
- Subject: error: 'mutex' is not a member of 'std'
- Authentication-results: sourceware.org; auth=none
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;
^
it looks libstdc++ does NOT include mutex feature while building
so, i re-checked gcc build option
it is like this:
$ /top/bin/g++ -v
Reading specs from /top/bin/../lib/gcc/x86_64-baidu-linux-gnu/4.8.2/specs
COLLECT_GCC=/top/bin/g++
COLLECT_LTO_WRAPPER=/top/bin/../libexec/gcc/x86_64-baidu-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-baidu-linux-gnu
Configured with: ../configure CFLAGS=-O2 --host=x86_64-baidu-linux-gnu
--target=x86_64-baidu-linux-gnu --prefix=/usr --with-sysroot
--with-local-prefix=/ --with-native-system-header-dir=/top/include
--with-build-sysroot=/top --enable-languages=c,c++ --enable-c99
--enable-threads=posix --enable-libstdcxx-allocator
--enable-libstdcxx-threads --enable-libstdcxx-time
--enable-libstdcxx-visibility --disable-multilib --disable-bootstrap
--disable-shared
Thread model: posix
gcc version 4.8.2 (GCC)
i have checked gcc build option between my toolchain and fedora's,
which is not have compile error with my test code, but i don't find
some option special.
so, how could i fix this issue, or should i give more information to get help?
thank you
Q.Z
2013-11-13