Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

下载后编译分支cpp11,因Hiredis文件提示编译失败 #372

Open
YY-Edwards opened this issue Jan 16, 2019 · 1 comment
Open

下载后编译分支cpp11,因Hiredis文件提示编译失败 #372

YY-Edwards opened this issue Jan 16, 2019 · 1 comment

Comments

@YY-Edwards
Copy link

Linux distro and version? x86 or ARM? 32-bit or 64-bit?

Linux ubuntu 4.4.0-62-generic x86_64
Ubuntu 16.04.2 LTS

Branch (cpp98/cpp11/cpp17) and version of muduo?

cpp11 v2.0,0

Version of cmake, gcc and boost? (If not from distro.)

cmake version 3.5.1
gcc version 5.4.0
boost version 1.58.0

##下载后编译分支cpp11,因Hiredis文件提示编译失败
编译出错提示如下:
Scanning dependencies of target mrediscli
[ 40%] Building CXX object contrib/hiredis/CMakeFiles/mrediscli.dir/Hiredis.cc.o
In file included from /opt/muduo_lib_file/version_cpp11/make_branchcp11_file/muduo-cpp11/contrib/hiredis/Hiredis.cc:1:0:
/opt/muduo_lib_file/version_cpp11/make_branchcp11_file/muduo-cpp11/contrib/hiredis/Hiredis.h:27:1: error: expected class-name before ‘{’ token
{
^
contrib/hiredis/CMakeFiles/mrediscli.dir/build.make:62: recipe for target 'contrib/hiredis/CMakeFiles/mrediscli.dir/Hiredis.cc.o' failed
make[2]: *** [contrib/hiredis/CMakeFiles/mrediscli.dir/Hiredis.cc.o] Error 1
CMakeFiles/Makefile2:1992: recipe for target 'contrib/hiredis/CMakeFiles/mrediscli.dir/all' failed
make[1]: *** [contrib/hiredis/CMakeFiles/mrediscli.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

查看contrib/hiredis/Hiredis.h文件,类继承muduo::noncopyable,而编译过程中似乎无法识别。
之前的版本(v1.1.0)里是使用boost里的头文件:#include <boost/noncopyable.hpp>。

现在是cpp11版本,直接包含已实现的头文件:#include <muduo/base/noncopyable.h>则编译正常识别并通过。

不知道这个问题是否需要修复?

@chenshuo
Copy link
Owner

chenshuo commented Jan 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants