From 7f787bd08371066e616a4a784712b237f0bab7fa Mon Sep 17 00:00:00 2001 From: Hao Nguyen Date: Tue, 11 Jun 2019 12:12:33 -0700 Subject: [PATCH] Link against pthread in examples --- examples/cpp/helloworld/Makefile | 2 ++ examples/cpp/route_guide/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/cpp/helloworld/Makefile b/examples/cpp/helloworld/Makefile index 6af92347aa3..9af7337fd1b 100644 --- a/examples/cpp/helloworld/Makefile +++ b/examples/cpp/helloworld/Makefile @@ -21,10 +21,12 @@ CPPFLAGS += `pkg-config --cflags protobuf grpc` CXXFLAGS += -std=c++11 ifeq ($(SYSTEM),Darwin) LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc`\ + -pthread\ -lgrpc++_reflection\ -ldl else LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++ grpc`\ + -pthread\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -ldl endif diff --git a/examples/cpp/route_guide/Makefile b/examples/cpp/route_guide/Makefile index 48a2073ba8c..3bf61cb76f1 100644 --- a/examples/cpp/route_guide/Makefile +++ b/examples/cpp/route_guide/Makefile @@ -21,10 +21,12 @@ CPPFLAGS += `pkg-config --cflags protobuf grpc` CXXFLAGS += -std=c++11 ifeq ($(SYSTEM),Darwin) LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\ + -pthread\ -lgrpc++_reflection\ -ldl else LDFLAGS += -L/usr/local/lib `pkg-config --libs protobuf grpc++`\ + -pthread\ -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed\ -ldl endif