diff options
Diffstat (limited to 'examples/pubsub/main.cc')
-rw-r--r-- | examples/pubsub/main.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/pubsub/main.cc b/examples/pubsub/main.cc index d752685545..39fb8aea15 100644 --- a/examples/pubsub/main.cc +++ b/examples/pubsub/main.cc @@ -40,7 +40,7 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> -#include <google/gflags.h> +#include <gflags/gflags.h> #include <grpc++/channel_interface.h> #include <grpc++/create_channel.h> #include <grpc++/credentials.h> @@ -60,6 +60,13 @@ DEFINE_string(oauth_scope, "https://www.googleapis.com/auth/cloud-platform", "Scope for OAuth tokens."); +// In some distros, gflags is in the namespace google, and in some others, +// in gflags. This hack is enabling us to find both. +namespace google { } +namespace gflags { } +using namespace google; +using namespace gflags; + namespace { const char kTopic[] = "testtopics"; @@ -81,7 +88,7 @@ grpc::string GetServiceAccountJsonKey() { int main(int argc, char** argv) { grpc_init(); - google::ParseCommandLineFlags(&argc, &argv, true); + ParseCommandLineFlags(&argc, &argv, true); gpr_log(GPR_INFO, "Start PUBSUB client"); std::ostringstream ss; |