baidu / sofa-pbrpc

A light-weight RPC implement of google protobuf RPC framework.
Other
2.13k stars 655 forks source link

在unbuntu16.10环境,unit_test的编译error,怎么解决? #189

Closed NanQiAi closed 7 years ago

NanQiAi commented 7 years ago

g++ -g2 -pipe -W -Wall -fPIC -D_GNU_SOURCE -DSTDC_LIMIT_MACROS -Dprivate=public -I. -I../src -I/home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/boost -I/home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/protobuf/output/include -I/home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/snappy/output/include -I/home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/zlib/output/include -I/home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/gtest/include -c test_common.cc -o test_common.o In file included from /home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/gtest/include/gtest/internal/gtest-port.h:212:0, from /home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/gtest/include/gtest/internal/gtest-internal.h:40, from /home/eric/desktop/code/cpp_program/sofa-pbrpc/lib/gtest/include/gtest/gtest.h:58, from test_common.cc:8: **/usr/include/c++/6/sstream:300:7: error: ‘struct std::cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>::xfer_bufptrs’ redeclared with different access struct xfer_bufptrs** ^~ Makefile:114: recipe for target 'test_common.o' failed

ps:gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)

demiaowu commented 7 years ago

也许可以参考:#164

qinzuoyan commented 7 years ago

多谢 @demiaowu 。

@victorustc ,你将 #164 的修复revert一下,改为"-Dprivate=public"试试?

NanQiAi commented 7 years ago

@demiaowu @qinzuoyan 多谢~~ 在Makefile中 将-CXXFLAGS += $(OPT) -pipe -W -Wall -fPIC -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -Dprivate=public $(INCPATH)

改为+CXXFLAGS += $(OPT) -pipe -W -Wall -fPIC -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -fno-access-control $(INCPATH) 问题就解决了。