chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.87k stars 5.17k forks source link

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

Open YY-Edwards opened 5 years ago

YY-Edwards commented 5 years ago

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 commented 5 years ago

欢迎提 pull request.

On Tue, Jan 15, 2019, 6:51 PM YY-Edwards <notifications@github.com wrote:

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>则编译正常识别并通过。

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chenshuo/muduo/issues/372, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOGolsb1ATqwuwHQbEzqYtw-8I1MwV6ks5vDpO4gaJpZM4aCNer .