This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error: 'mutex' is not a member of 'std'


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]