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

debian-stretch-slim下编译报错 #47

Open
totemofwolf opened this issue Aug 31, 2019 · 3 comments
Open

debian-stretch-slim下编译报错 #47

totemofwolf opened this issue Aug 31, 2019 · 3 comments

Comments

@totemofwolf
Copy link

$ g++ --version
g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make COMPILER=g++ STATIC_LINK=1

clang++ -c -std=c++0x -D_XOPEN_SOURCE -DELPP_THREAD_SAFE    -Wall -Wextra -Wold-style-cast -Werror -O3 -DELPP_DISABLE_DEBUG_LOGS -DELPP_NO_DEFAULT_LOG_FILE -I. core/command.cpp -o ./build/command.o
core/command.cpp:261:25: error: no member named 'accumulate' in namespace 'std'
            return std::accumulate(
                   ~~~~~^
1 error generated.

# 然后我在core/command.cpp里插入 #include <numeric> 解决了,但还报如下错:

In file included from core/slot_map.cpp:5:0:
core/slot_map.hpp:83:31: error: 'std::vector' has not been declared
         void replace_map(std::vector<RedisNode> const& nodes, Proxy* proxy);
                               ^~~~~~
core/slot_map.hpp:83:37: error: expected ',' or '...' before '<' token
         void replace_map(std::vector<RedisNode> const& nodes, Proxy* proxy);
                                     ^
core/slot_map.hpp:90:10: error: 'vector' in namespace 'std' does not name a template type
     std::vector<RedisNode> parse_slot_map(std::string const& nodes_info,
          ^~~~~~
core/slot_map.cpp:56:6: error: prototype for 'void cerb::SlotMap::replace_map(const std::vector<cerb::RedisNode>&, cerb::Proxy*)' does not match any in class 'cerb::SlotMap'
 void SlotMap::replace_map(std::vector<RedisNode> const& nodes, Proxy* proxy)
      ^~~~~~~
In file included from core/slot_map.cpp:5:0:
core/slot_map.hpp:83:14: error: candidate is: void cerb::SlotMap::replace_map(int)
         void replace_map(std::vector<RedisNode> const& nodes, Proxy* proxy);
              ^~~~~~~~~~~
core/slot_map.cpp:111:76: error: 'std::vector<cerb::RedisNode> cerb::parse_slot_map(const string&, const string&)' should have been declared inside 'cerb'
                                             std::string const& default_host)
                                                                            ^
/tmp/tmp.s7Hv765rf0:8: recipe for target 'build/slot_map.o' failed
@totemofwolf
Copy link
Author

由于不晓得怎么PR,我fork后修改了一份:
totemofwolf@f14bf90

蛤蛤..

@zheplusplus
Copy link
Contributor

@totemofwolf 谢谢报告. 如何创建 PR 可以看 Github 官方帮助
https://help.github.com/en/articles/creating-a-pull-request-from-a-fork (页面上方菜单可以切换至中文版)

在预处理部分, 请将标准库头文件放在一起, 并置于其它 include 之前. 如

#include <algorithm>
+ #include <numeric>
#include <cppformat/format.h>

@totemofwolf
Copy link
Author

已提交。

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