sochinpub opened a new issue #1272:
URL: https://github.com/apache/incubator-brpc/issues/1272


   **Describe the bug (描述bug)**
   
   编译example出错:
   incubator-brpc/example/echo_c++# make -j
   > Generating echo.pb.cc
   /usr/bin/protoc --cpp_out=. --proto_path=.  echo.proto
   > Compiling client.o
   g++ -c -I/usr/include/ -I../../output/include -DBRPC_WITH_GLOG=0 
-DGFLAGS_NS=google -g -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall 
-Wno-unused-parameter -fPIC -fno-omit-frame-pointer client.cpp -o client.o
   > Compiling server.o
   g++ -c -I/usr/include/ -I../../output/include -DBRPC_WITH_GLOG=0 
-DGFLAGS_NS=google -g -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall 
-Wno-unused-parameter -fPIC -fno-omit-frame-pointer server.cpp -o server.o
   > Compiling echo.pb.o
   g++ -c -I/usr/include/ -I../../output/include -DBRPC_WITH_GLOG=0 
-DGFLAGS_NS=google -g -std=c++0x -DNDEBUG -O2 -D__const__= -pipe -W -Wall 
-Wno-unused-parameter -fPIC -fno-omit-frame-pointer echo.pb.cc -o echo.pb.o
   > Linking echo_client
   g++ -L/usr/lib/x86_64-linux-gnu -L../../output/lib -Xlinker "-(" echo.pb.o 
client.o -Wl,-Bstatic -lgflags -lprotobuf -lleveldb -lsnappy -lbrpc 
-Wl,-Bdynamic -Xlinker "-)" -lpthread -lssl -lcrypto -ldl -lz -lrt -o 
echo_client
   > Linking echo_server
   g++ -L/usr/lib/x86_64-linux-gnu -L../../output/lib -Xlinker "-(" echo.pb.o 
server.o -Wl,-Bstatic -lgflags -lprotobuf -lleveldb -lsnappy -lbrpc 
-Wl,-Bdynamic -Xlinker "-)" -lpthread -lssl -lcrypto -ldl -lz -lrt -o 
echo_server
   /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation 
R_X86_64_32S against `.rodata' can not be used when making a shared object; 
recompile with -fPIC
   /usr/bin/ld: final link failed: Nonrepresentable section on output
   collect2: error: ld returned 1 exit status
   Makefile:69: recipe for target 'echo_client' failed
   make: *** [echo_client] Error 1
   make: *** Waiting for unfinished jobs....
   /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libsnappy.a(snappy.o): relocation 
R_X86_64_32S against `.rodata' can not be used when making a shared object; 
recompile with -fPIC
   /usr/bin/ld: final link failed: Nonrepresentable section on output
   collect2: error: ld returned 1 exit status
   Makefile:77: recipe for target 'echo_server' failed
   make: *** [echo_server] Error 1
   rm echo.pb.cc
   
   **To Reproduce (复现方法)**
   
   编译example
   
   **Expected behavior (期望行为)**
   成功编译
   
   **Versions (各种版本)**
   OS: debian 9(4.19)
   Compiler: gcc
   brpc: master
   protobuf:1.2.1-2 amd64
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to