Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


error: 'mutex' in namespace 'std' does not name a type

error: 'mutex' in namespace 'std' does not name a type

error: 'mutex' in namespace 'std' does not name a type

I am trying to compile grpc on AIX. After fixing a few GCC8 warnings, I run into the following error:

In file included from include/grpcpp/impl/codegen/call.h:30,
from include/grpcpp/impl/call.h:22,
from include/grpcpp/channel.h:25,
from src/cpp/client/insecure_credentials.cc:23:
include/grpcpp/impl/codegen/client_context.h:419:8: error: 'mutex' in namespace 'std' does not name a type
std::mutex mu_;
include/grpcpp/impl/codegen/client_context.h:419:3: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
+#include <mutex>

std::mutex mu_;

The following stackoverflow post gives some context: https://stackoverflow.com/questions/14191566/c-mut...

However I am not sure why this is happening on AIX. Is it because of a similar problem? Is there a known workaround?

RE: error: 'mutex' in namespace 'std' does not name a type

Setting CXXFLAGS=-pthread takes care of this.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close