gaowayne opened a new issue, #1934:
URL: https://github.com/apache/incubator-brpc/issues/1934
**Describe the bug (描述bug)**
I try to bring bRPC in my project.
**To Reproduce (复现方法)**
below is my g++ command to build braft client code
```
<built-in>: note: this is the location of the previous definition
In file included from
/usr/local/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
from
/usr/local/include/boost/smart_ptr/detail/yield_k.hpp:23,
from
/usr/local/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
from
/usr/local/include/boost/smart_ptr/detail/spinlock.hpp:42,
from
/usr/local/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:29,
from /usr/local/include/boost/shared_ptr.hpp:17,
from /usr/local/include/boost/date_time/time_clock.hpp:17,
from /usr/local/include/boost/thread/thread_time.hpp:9,
from /usr/local/include/boost/thread/lock_types.hpp:18,
from
/usr/local/include/boost/thread/pthread/thread_data.hpp:12,
from /usr/local/include/boost/thread/thread_only.hpp:17,
from /usr/local/include/boost/thread/thread.hpp:12,
from /usr/local/include/boost/thread.hpp:13,
from null.c:19:
/usr/local/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice
of declaring the Bind placeholders (_1, _2, ...) in the global namespace is
deprecated. Please use <boost/bind/bind.hpp> + using namespace
boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the
current behavior.’
36 | BOOST_PRAGMA_MESSAGE(
| ^~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccGYO7dP.o: relocation R_X86_64_TPOFF32 against symbol
`_ZN5boost4asio6detail15keyword_tss_ptrINS1_10call_stackINS1_14thread_contextENS1_16thread_info_baseEE7contextEE6value_E'
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libprotobuf.a(arena.o): relocation
R_X86_64_TPOFF32 against symbol
`_ZN6google8protobuf8internal9ArenaImpl13thread_cache_E' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgflags.a(gflags.cc.o): relocation
R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making
a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
root@wcp116:/home/intel/wayne/debugfio/fio-brpc/fio/engines#
```
build command
```
root@wcp116:/home/intel/wayne/debugfio/fio-brpc/fio/engines# g++ -O0 -g
-ggdb -shared -rdynamic -o cpp_null null.c -I /usr/local/include/boost
-I/root/wayne/braft/debug/incubator-brpc/output/include -include
../config-host.h -DBRPC_WITH_GLOG=0 -L /usr/local/lib/boost -lboost_system
-L/usr/lib/x86_64-linux-gnu -L/root/wayne/braft/debug/incubator-brpc/output/lib
-Xlinker "-(" echo.pb.o -Wl,-Bstatic -lgflags -lprotobuf -lleveldb -lsnappy
-lbrpc -Wl,-Bdynamic -Xlinker "-)" -lpthread -lssl -lcrypto -ldl -lz -lrt
-lboost_thread -DFIO_EXTERNAL_ENGINE
```
**Expected behavior (期望行为)**
can build and run through bRPC client
**Versions (各种版本)**
OS: FedoraOS33
Compiler:
brpc:
protobuf:
**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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]