登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
Gitee AI
NEW
我知道了
查看详情
登录
注册
1月18日,北京,聊聊2025如何加入技术开发?
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
5
Star
21
Fork
14
cpp-master
/
cpp-tbox-tutorials
代码
Issues
1
Pull Requests
0
Wiki
统计
流水线
服务
Gitee Pages
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
我知道了,不再自动展开
更新失败,请稍后重试!
Issues
/
详情
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
01-first-module编译需增加C++11的支持
待办的
#IB4KLJ
mojinpan
创建于
2024-11-15 11:17
01-first-module编译报错: ``` root@ubuntu:/home/work/cpp-tbox-tutorials/01-first-module# make g++ -I/root/.tbox/include -c -o app_main.o app_main.cpp In file included from /usr/include/c++/5/cstdint:35:0, from /root/.tbox/include/nlohmann/json_fwd.hpp:4, from /root/.tbox/include/tbox/base/json_fwd.h:23, from /root/.tbox/include/tbox/main/module.h:24, from app_main.cpp:1: /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support \ ^ In file included from /root/.tbox/include/tbox/base/json_fwd.h:23:0, from /root/.tbox/include/tbox/main/module.h:24, from app_main.cpp:1: /root/.tbox/include/nlohmann/json_fwd.hpp:27:51: warning: variadic templates only available with -std=c++11 or -std=gnu++11 template<template<typename U, typename V, typename... Args> class ObjectType = ^ /root/.tbox/include/nlohmann/json_fwd.hpp:29:39: warning: variadic templates only available with -std=c++11 or -std=gnu++11 template<typename U, typename... Args> class ArrayType = std::vector, ^ /root/.tbox/include/nlohmann/json_fwd.hpp:31:41: error: ‘int64_t’ in namespace ‘std’ does not name a type class NumberIntegerType = std::int64_t, ^ /root/.tbox/include/nlohmann/json_fwd.hpp:32:42: error: ‘uint64_t’ in namespace ‘std’ does not name a type class NumberUnsignedType = std::uint64_t, ^ /root/.tbox/include/nlohmann/json_fwd.hpp:37:41: error: ‘uint8_t’ is not a member of ‘std’ class BinaryType = std::vector<std::uint8_t>> ^ /root/.tbox/include/nlohmann/json_fwd.hpp:37:41: error: ‘uint8_t’ is not a member of ‘std’ /root/.tbox/include/nlohmann/json_fwd.hpp:38:7: error: template argument 1 is invalid class basic_json; ^ /root/.tbox/include/nlohmann/json_fwd.hpp:38:7: error: template argument 2 is invalid /root/.tbox/include/nlohmann/json_fwd.hpp:38:17: error: expected ‘>’ before ‘;’ token class basic_json; ^ /root/.tbox/include/nlohmann/json_fwd.hpp:38:17: error: expected unqualified-id before ‘;’ token /root/.tbox/include/nlohmann/json_fwd.hpp:62:7: error: expected nested-name-specifier before ‘json’ using json = basic_json<>; ^ /root/.tbox/include/nlohmann/json_fwd.hpp:74:7: error: expected nested-name-specifier before ‘ordered_json’ using ordered_json = basic_json<nlohmann::ordered_map>; ^ In file included from /root/.tbox/include/tbox/main/module.h:24:0, from app_main.cpp:1: /root/.tbox/include/tbox/base/json_fwd.h:32:7: error: expected nested-name-specifier before ‘Json’ using Json = nlohmann::json; ^ /root/.tbox/include/tbox/base/json_fwd.h:33:7: error: expected nested-name-specifier before ‘OrderedJson’ using OrderedJson = nlohmann::ordered_json; ^ In file included from /root/.tbox/include/tbox/event/loop.h:29:0, from /root/.tbox/include/tbox/main/context.h:25, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/event/stat.h:30:5: error: ‘uint64_t’ does not name a type uint64_t stat_time_us = 0; //! 统计时长 ^ /root/.tbox/include/tbox/event/stat.h:32:5: error: ‘uint64_t’ does not name a type uint64_t loop_count = 0; //! 循环次数 ^ /root/.tbox/include/tbox/event/stat.h:33:5: error: ‘uint64_t’ does not name a type uint64_t loop_acc_cost_us = 0; //! 循环执行累积时长 ^ /root/.tbox/include/tbox/event/stat.h:34:5: error: ‘uint64_t’ does not name a type uint64_t loop_peak_cost_us = 0; //! 循环执行时长峰值 ^ /root/.tbox/include/tbox/event/stat.h:36:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t run_in_loop_peak_num = 0; //!< 等待任务数峰值 ^ /root/.tbox/include/tbox/event/stat.h:37:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t run_next_peak_num = 0; //!< 等待任务数峰值 ^ In file included from /root/.tbox/include/tbox/main/context.h:25:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/event/loop.h:43:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class Mode { ^ /root/.tbox/include/tbox/event/loop.h:51:38: error: ‘chrono’ in namespace ‘std’ does not name a type virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:59: error: expected unqualified-id before ‘&’ token virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:59: error: expected ‘)’ before ‘&’ token /root/.tbox/include/tbox/event/loop.h:51:46: error: expected ‘;’ at end of member declaration virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:104: error: ISO C++ forbids declaration of ‘wait_time’ with no type [-fpermissive] virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:104: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 /root/.tbox/include/tbox/event/loop.h:51:104: error: expected ‘;’ at end of member declaration /root/.tbox/include/tbox/event/loop.h:51:105: error: expected unqualified-id before ‘)’ token virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:60:11: error: expected nested-name-specifier before ‘RunId’ using RunId = uint64_t; ^ /root/.tbox/include/tbox/event/loop.h:61:11: error: expected nested-name-specifier before ‘Func’ using Func = std::function<void()>; ^ /root/.tbox/include/tbox/event/loop.h:85:13: error: ‘RunId’ does not name a type virtual RunId runInLoop(Func &&func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:86:13: error: ‘RunId’ does not name a type virtual RunId runInLoop(const Func &func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:87:13: error: ‘RunId’ does not name a type virtual RunId runNext(Func &&func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:88:13: error: ‘RunId’ does not name a type virtual RunId runNext(const Func &func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:89:13: error: ‘RunId’ does not name a type virtual RunId run(Func &&func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:90:13: error: ‘RunId’ does not name a type virtual RunId run(const Func &func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:91:26: error: ‘RunId’ has not been declared virtual bool cancel(RunId run_id) = 0; ^ /root/.tbox/include/tbox/event/loop.h:106:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds wake_delay; //!< loop 唤醒延迟 ^ /root/.tbox/include/tbox/event/loop.h:107:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds loop_cost; //!< loop 时间消耗 ^ /root/.tbox/include/tbox/event/loop.h:108:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds event_cb_cost; //!< 事件回调时间消耗 ^ /root/.tbox/include/tbox/event/loop.h:109:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds run_cb_cost; //!< Run回调时间消耗 ^ /root/.tbox/include/tbox/event/loop.h:110:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds run_in_loop_delay; //!< runInLoop() 执行延迟 ^ /root/.tbox/include/tbox/event/loop.h:111:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds run_next_delay; //!< runNext() 执行延迟 ^ /root/.tbox/include/tbox/event/loop.h:112:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds timer_delay; //!< 定时器延迟 ^ /root/.tbox/include/tbox/event/loop.h:49:38: error: ‘Mode’ is not a class or namespace virtual void runLoop(Mode mode = Mode::kForever) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:77: error: ‘std::chrono’ has not been declared virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ In file included from /root/.tbox/include/tbox/eventx/thread_pool.h:27:0, from /root/.tbox/include/tbox/main/context.h:26, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/base/cabinet_token.h:28:7: error: expected nested-name-specifier before ‘Id’ using Id = size_t; ^ /root/.tbox/include/tbox/base/cabinet_token.h:29:7: error: expected nested-name-specifier before ‘Pos’ using Pos = size_t; ^ /root/.tbox/include/tbox/base/cabinet_token.h:35:14: error: expected ‘)’ before ‘id’ Token(Id id, Pos pos) : id_(id), pos_(pos) { } ^ /root/.tbox/include/tbox/base/cabinet_token.h:37:12: error: ‘Id’ does not name a type inline Id id() const { return id_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:38:12: error: ‘Pos’ does not name a type inline Pos pos() const { return pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:57:5: error: ‘Id’ does not name a type Id id_ = 0; ^ /root/.tbox/include/tbox/base/cabinet_token.h:58:5: error: ‘Pos’ does not name a type Pos pos_ = 0; ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘void tbox::cabinet::Token::reset()’: /root/.tbox/include/tbox/base/cabinet_token.h:40:27: error: ‘id_’ was not declared in this scope inline void reset() { id_ = 0; pos_ = 0; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:40:36: error: ‘pos_’ was not declared in this scope inline void reset() { id_ = 0; pos_ = 0; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘bool tbox::cabinet::Token::isNull() const’: /root/.tbox/include/tbox/base/cabinet_token.h:41:41: error: ‘id_’ was not declared in this scope inline bool isNull() const { return id_ == 0; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘bool tbox::cabinet::Token::equal(const tbox::cabinet::Token&) const’: /root/.tbox/include/tbox/base/cabinet_token.h:43:58: error: ‘id_’ was not declared in this scope inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:43:71: error: ‘const class tbox::cabinet::Token’ has no member named ‘id_’ inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:43:78: error: ‘pos_’ was not declared in this scope inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:43:92: error: ‘const class tbox::cabinet::Token’ has no member named ‘pos_’ inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘bool tbox::cabinet::Token::less(const tbox::cabinet::Token&) const’: /root/.tbox/include/tbox/base/cabinet_token.h:44:58: error: ‘id_’ was not declared in this scope inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:71: error: ‘const class tbox::cabinet::Token’ has no member named ‘id_’ inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:89: error: ‘const class tbox::cabinet::Token’ has no member named ‘id_’ inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:95: error: ‘pos_’ was not declared in this scope inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:108: error: ‘const class tbox::cabinet::Token’ has no member named ‘pos_’ inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘size_t tbox::cabinet::Token::hash() const’: /root/.tbox/include/tbox/base/cabinet_token.h:45:42: error: ‘id_’ was not declared in this scope inline size_t hash() const { return (id_ << 8) | (pos_ & 0xff); } ^ /root/.tbox/include/tbox/base/cabinet_token.h:45:55: error: ‘pos_’ was not declared in this scope inline size_t hash() const { return (id_ << 8) | (pos_ & 0xff); } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘tbox::cabinet::Token::operator bool() const’: /root/.tbox/include/tbox/base/cabinet_token.h:54:44: error: ‘id_’ was not declared in this scope inline operator bool () const { return id_ != 0; } ^ In file included from /root/.tbox/include/tbox/main/context.h:26:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/thread_pool.h: At global scope: /root/.tbox/include/tbox/eventx/thread_pool.h:47:11: error: expected nested-name-specifier before ‘TaskToken’ using TaskToken = cabinet::Token; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:67:11: error: expected nested-name-specifier before ‘NonReturnFunc’ using NonReturnFunc = std::function<void ()>; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:77:5: error: ‘TaskToken’ does not name a type TaskToken execute(NonReturnFunc &&backend_task, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:78:5: error: ‘TaskToken’ does not name a type TaskToken execute(const NonReturnFunc &backend_task, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:89:5: error: ‘TaskToken’ does not name a type TaskToken execute(NonReturnFunc &&backend_task, NonReturnFunc &&main_cb, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:90:5: error: ‘TaskToken’ does not name a type TaskToken execute(const NonReturnFunc &backend_task, const NonReturnFunc &main_cb, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:92:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class TaskStatus { ^ /root/.tbox/include/tbox/eventx/thread_pool.h:99:30: error: ‘TaskToken’ has not been declared TaskStatus getTaskStatus(TaskToken task_token) const; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:110:16: error: ‘TaskToken’ has not been declared int cancel(TaskToken task_token); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:119:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t thread_num = 0; //!< 当前存活线程数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:120:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t idle_thread_num = 0; //!< 空闲线程数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:121:14: error: ‘array’ in namespace ‘std’ does not name a template type std::array<size_t, THREAD_POOL_PRIO_SIZE> undo_task_num; //! 各优先级等待任务数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:122:33: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t doing_task_num = 0; //!< 正在执行的任务数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:123:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t undo_task_peak_num = 0; //!< 等待任务数峰值 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:130:11: error: expected nested-name-specifier before ‘ThreadToken’ using ThreadToken = cabinet::Token; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:132:21: error: ‘ThreadToken’ has not been declared void threadProc(ThreadToken thread_token); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:142:16: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 Data *d_ = nullptr; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:142:16: error: ‘nullptr’ was not declared in this scope In file included from /root/.tbox/include/tbox/main/context.h:27:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/timer_pool.h:39:11: error: expected nested-name-specifier before ‘TimerToken’ using TimerToken = cabinet::Token; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:40:11: error: expected nested-name-specifier before ‘Callback’ using Callback = std::function<void()>; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:41:11: error: expected nested-name-specifier before ‘Milliseconds’ using Milliseconds = std::chrono::milliseconds; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:42:11: error: expected nested-name-specifier before ‘TimePoint’ using TimePoint = std::chrono::system_clock::time_point; ^ In file included from /root/.tbox/include/tbox/eventx/timer_pool.h:28:0, from /root/.tbox/include/tbox/main/context.h:27, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/base/defines.h:38:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(const class_name&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:48:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:39:51: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (const class_name &) = delete ^ /root/.tbox/include/tbox/eventx/timer_pool.h:48:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:43:27: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:43:33: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:43:33: error: invalid constructor; you probably meant ‘tbox::eventx::TimerPool (const tbox::eventx::TimerPool&)’ class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:44:40: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:44:46: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ In file included from /root/.tbox/include/tbox/main/context.h:27:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/timer_pool.h:52:5: error: ‘TimerToken’ does not name a type TimerToken doEvery(const Milliseconds &m_sec, Callback &&cb); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:53:5: error: ‘TimerToken’ does not name a type TimerToken doAfter(const Milliseconds &m_sec, Callback &&cb); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:54:5: error: ‘TimerToken’ does not name a type TimerToken doAt(const TimePoint &time_point, Callback &&cb); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:59:23: error: ‘TimerToken’ does not name a type bool cancel(const TimerToken &token); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:65:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 Impl *impl_ = nullptr; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:65:19: error: ‘nullptr’ was not declared in this scope In file included from /root/.tbox/include/tbox/main/context.h:28:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/async.h:37:11: error: expected nested-name-specifier before ‘Callback’ using Callback = std::function<void(int)>; ^ /root/.tbox/include/tbox/eventx/async.h:38:11: error: expected nested-name-specifier before ‘StringCallback’ using StringCallback = std::function<void(int, std::string &)>; ^ /root/.tbox/include/tbox/eventx/async.h:39:11: error: expected nested-name-specifier before ‘StringVecCallback’ using StringVecCallback = std::function<void(int, std::vector<std::string> &)>; ^ /root/.tbox/include/tbox/eventx/async.h:41:48: error: ‘StringCallback’ has not been declared void readFile(const std::string &filename, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:41:63: error: expected ‘,’ or ‘...’ before ‘&&’ token void readFile(const std::string &filename, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:42:53: error: ‘StringVecCallback’ has not been declared void readFileLines(const std::string &filename, StringVecCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:42:71: error: expected ‘,’ or ‘...’ before ‘&&’ token void readFileLines(const std::string &filename, StringVecCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:44:101: error: ‘Callback’ has not been declared void writeFile (const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ /root/.tbox/include/tbox/eventx/async.h:44:110: error: expected ‘,’ or ‘...’ before ‘&&’ token void writeFile (const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = null ^ /root/.tbox/include/tbox/eventx/async.h:45:101: error: ‘Callback’ has not been declared void appendFile(const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ /root/.tbox/include/tbox/eventx/async.h:45:110: error: expected ‘,’ or ‘...’ before ‘&&’ token void appendFile(const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = null ^ /root/.tbox/include/tbox/eventx/async.h:47:50: error: ‘Callback’ has not been declared void removeFile(const std::string &filename, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:47:59: error: expected ‘,’ or ‘...’ before ‘&&’ token void removeFile(const std::string &filename, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:49:45: error: ‘Callback’ has not been declared void executeCmd(const std::string &cmd, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:49:54: error: expected ‘,’ or ‘...’ before ‘&&’ token void executeCmd(const std::string &cmd, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:50:45: error: ‘StringCallback’ has not been declared void executeCmd(const std::string &cmd, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:50:60: error: expected ‘,’ or ‘...’ before ‘&&’ token void executeCmd(const std::string &cmd, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:50:10: error: ‘void tbox::eventx::Async::executeCmd(const string&, int)’ cannot be overloaded void executeCmd(const std::string &cmd, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:49:10: error: with ‘void tbox::eventx::Async::executeCmd(const string&, int)’ void executeCmd(const std::string &cmd, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:44:10: error: default argument missing for parameter 4 of ‘void tbox::eventx::Async::writeFile(const string&, const string&, bool, int)’ void writeFile (const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ /root/.tbox/include/tbox/eventx/async.h:45:10: error: default argument missing for parameter 4 of ‘void tbox::eventx::Async::appendFile(const string&, const string&, bool, int)’ void appendFile(const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ In file included from /root/.tbox/include/tbox/terminal/terminal_nodes.h:23:0, from /root/.tbox/include/tbox/main/context.h:29, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/terminal/types.h:34:7: error: expected nested-name-specifier before ‘SessionToken’ using SessionToken = cabinet::Token; ^ /root/.tbox/include/tbox/terminal/types.h:35:7: error: expected nested-name-specifier before ‘NodeToken’ using NodeToken = cabinet::Token; ^ /root/.tbox/include/tbox/terminal/types.h:37:7: error: expected nested-name-specifier before ‘Args’ using Args = std::vector<std::string>; ^ /root/.tbox/include/tbox/terminal/types.h:38:7: error: expected nested-name-specifier before ‘Func’ using Func = std::function<void (const Session &s, const Args &)>; ^ In file included from /root/.tbox/include/tbox/terminal/terminal_nodes.h:24:0, from /root/.tbox/include/tbox/main/context.h:29, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/terminal/session.h:32:40: error: ‘SessionToken’ does not name a type Session(Connection *wp_conn, const SessionToken &st); ^ /root/.tbox/include/tbox/terminal/session.h:41:11: error: ‘SessionToken’ does not name a type const SessionToken st_; ^ In file included from /root/.tbox/include/tbox/main/context.h:29:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/terminal/terminal_nodes.h:35:13: error: ‘NodeToken’ does not name a type virtual NodeToken createFuncNode(const Func &func, const std::string &help = "") = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:37:13: error: ‘NodeToken’ does not name a type virtual NodeToken createDirNode(const std::string &help = "") = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:39:29: error: ‘NodeToken’ has not been declared virtual bool deleteNode(NodeToken node_token) = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:42:13: error: ‘NodeToken’ does not name a type virtual NodeToken rootNode() const = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:44:13: error: ‘NodeToken’ does not name a type virtual NodeToken findNode(const std::string &path) const = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:47:34: error: ‘NodeToken’ does not name a type virtual bool mountNode(const NodeToken &parent, const NodeToken &child, const std::string &name) = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:47:59: error: ‘NodeToken’ does not name a type virtual bool mountNode(const NodeToken &parent, const NodeToken &child, const std::string &name) = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:49:35: error: ‘NodeToken’ does not name a type virtual bool umountNode(const NodeToken &parent, const std::string &name) = 0; ^ In file included from /root/.tbox/include/tbox/main/context.h:30:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/coroutine/scheduler.h:33:7: error: expected nested-name-specifier before ‘RoutineToken’ using RoutineToken = cabinet::Token; ^ /root/.tbox/include/tbox/coroutine/scheduler.h:34:7: error: expected nested-name-specifier before ‘RoutineEntry’ using RoutineEntry = std::function<void(Scheduler&)>; ^ In file included from /root/.tbox/include/tbox/eventx/timer_pool.h:28:0, from /root/.tbox/include/tbox/main/context.h:27, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/base/defines.h:38:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(const class_name&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:46:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:39:51: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (const class_name &) = delete ^ /root/.tbox/include/tbox/coroutine/scheduler.h:46:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:43:27: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:43:33: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:43:33: error: invalid constructor; you probably meant ‘tbox::coroutine::Scheduler (const tbox::coroutine::Scheduler&)’ class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:44:40: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:44:46: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ In file included from /root/.tbox/include/tbox/main/context.h:30:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/coroutine/scheduler.h:51:5: error: ‘RoutineToken’ does not name a type RoutineToken create(const RoutineEntry &entry, ^ /root/.tbox/include/tbox/coroutine/scheduler.h:56:23: error: ‘RoutineToken’ does not name a type bool resume(const RoutineToken &token); //! 恢复指定协程 ^ /root/.tbox/include/tbox/coroutine/scheduler.h:57:23: error: ‘RoutineToken’ does not name a type bool cancel(const RoutineToken &token); //! 取消指定协程,只能给协程发送了取消请求,并非立 ^ /root/.tbox/include/tbox/coroutine/scheduler.h:63:21: error: ‘RoutineToken’ does not name a type bool join(const RoutineToken &other_routine); //! 一个协程等待另一个协程结束 ^ /root/.tbox/include/tbox/coroutine/scheduler.h:65:5: error: ‘RoutineToken’ does not name a type RoutineToken getToken() const; //! 获取当前协程token ^ /root/.tbox/include/tbox/coroutine/scheduler.h:83:16: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 Data *d_ = nullptr; ^ /root/.tbox/include/tbox/coroutine/scheduler.h:83:16: error: ‘nullptr’ was not declared in this scope In file included from /root/.tbox/include/tbox/main/module.h:25:0, from app_main.cpp:1: /root/.tbox/include/tbox/main/context.h:45:18: error: ‘chrono’ in namespace ‘std’ does not name a type virtual std::chrono::milliseconds running_time() const = 0; ^ /root/.tbox/include/tbox/main/context.h:46:18: error: ‘chrono’ in namespace ‘std’ does not name a type virtual std::chrono::system_clock::time_point start_time_point() const = 0; ^ In file included from app_main.cpp:1:0: /root/.tbox/include/tbox/main/module.h:74:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class State { ^ In file included from app_main.cpp:1:0: /root/.tbox/include/tbox/main/module.h:99:28: error: ‘Json’ has not been declared void fillDefaultConfig(Json &js_parent); ^ /root/.tbox/include/tbox/main/module.h:100:27: error: ‘Json’ does not name a type bool initialize(const Json &js_parent); ^ /root/.tbox/include/tbox/main/module.h:113:38: error: ‘Json’ has not been declared virtual void onFillDefaultConfig(Json &js_this) { (void)js_this; } ^ /root/.tbox/include/tbox/main/module.h:115:31: error: ‘Json’ does not name a type virtual bool onInit(const Json &js_this) { (void)js_this; return true; } ^ /root/.tbox/include/tbox/main/module.h:132:27: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 State state_ = State::kNone; ^ /root/.tbox/include/tbox/main/module.h:132:20: error: ‘State’ is not a class or namespace State state_ = State::kNone; ^ <builtin>: recipe for target 'app_main.o' failed make: *** [app_main.o] Error 1 ``` 在makefile中增加c++11的要求后通过编译 ``` TARGET:=demo OBJECTS:=app_main.o CXXFLAGS:=-I$(HOME)/.tbox/include -std=c++11 LDFLAGS:=-L$(HOME)/.tbox/lib -rdynamic LIBS:=\ -ltbox_main \ -ltbox_coroutine \ -ltbox_trace \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ -ltbox_event \ -ltbox_log \ -ltbox_util \ -ltbox_base \ -lpthread -ldl $(TARGET): $(OBJECTS) g++ -o $@ $^ $(LDFLAGS) $(LIBS) ```
01-first-module编译报错: ``` root@ubuntu:/home/work/cpp-tbox-tutorials/01-first-module# make g++ -I/root/.tbox/include -c -o app_main.o app_main.cpp In file included from /usr/include/c++/5/cstdint:35:0, from /root/.tbox/include/nlohmann/json_fwd.hpp:4, from /root/.tbox/include/tbox/base/json_fwd.h:23, from /root/.tbox/include/tbox/main/module.h:24, from app_main.cpp:1: /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support \ ^ In file included from /root/.tbox/include/tbox/base/json_fwd.h:23:0, from /root/.tbox/include/tbox/main/module.h:24, from app_main.cpp:1: /root/.tbox/include/nlohmann/json_fwd.hpp:27:51: warning: variadic templates only available with -std=c++11 or -std=gnu++11 template<template<typename U, typename V, typename... Args> class ObjectType = ^ /root/.tbox/include/nlohmann/json_fwd.hpp:29:39: warning: variadic templates only available with -std=c++11 or -std=gnu++11 template<typename U, typename... Args> class ArrayType = std::vector, ^ /root/.tbox/include/nlohmann/json_fwd.hpp:31:41: error: ‘int64_t’ in namespace ‘std’ does not name a type class NumberIntegerType = std::int64_t, ^ /root/.tbox/include/nlohmann/json_fwd.hpp:32:42: error: ‘uint64_t’ in namespace ‘std’ does not name a type class NumberUnsignedType = std::uint64_t, ^ /root/.tbox/include/nlohmann/json_fwd.hpp:37:41: error: ‘uint8_t’ is not a member of ‘std’ class BinaryType = std::vector<std::uint8_t>> ^ /root/.tbox/include/nlohmann/json_fwd.hpp:37:41: error: ‘uint8_t’ is not a member of ‘std’ /root/.tbox/include/nlohmann/json_fwd.hpp:38:7: error: template argument 1 is invalid class basic_json; ^ /root/.tbox/include/nlohmann/json_fwd.hpp:38:7: error: template argument 2 is invalid /root/.tbox/include/nlohmann/json_fwd.hpp:38:17: error: expected ‘>’ before ‘;’ token class basic_json; ^ /root/.tbox/include/nlohmann/json_fwd.hpp:38:17: error: expected unqualified-id before ‘;’ token /root/.tbox/include/nlohmann/json_fwd.hpp:62:7: error: expected nested-name-specifier before ‘json’ using json = basic_json<>; ^ /root/.tbox/include/nlohmann/json_fwd.hpp:74:7: error: expected nested-name-specifier before ‘ordered_json’ using ordered_json = basic_json<nlohmann::ordered_map>; ^ In file included from /root/.tbox/include/tbox/main/module.h:24:0, from app_main.cpp:1: /root/.tbox/include/tbox/base/json_fwd.h:32:7: error: expected nested-name-specifier before ‘Json’ using Json = nlohmann::json; ^ /root/.tbox/include/tbox/base/json_fwd.h:33:7: error: expected nested-name-specifier before ‘OrderedJson’ using OrderedJson = nlohmann::ordered_json; ^ In file included from /root/.tbox/include/tbox/event/loop.h:29:0, from /root/.tbox/include/tbox/main/context.h:25, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/event/stat.h:30:5: error: ‘uint64_t’ does not name a type uint64_t stat_time_us = 0; //! 统计时长 ^ /root/.tbox/include/tbox/event/stat.h:32:5: error: ‘uint64_t’ does not name a type uint64_t loop_count = 0; //! 循环次数 ^ /root/.tbox/include/tbox/event/stat.h:33:5: error: ‘uint64_t’ does not name a type uint64_t loop_acc_cost_us = 0; //! 循环执行累积时长 ^ /root/.tbox/include/tbox/event/stat.h:34:5: error: ‘uint64_t’ does not name a type uint64_t loop_peak_cost_us = 0; //! 循环执行时长峰值 ^ /root/.tbox/include/tbox/event/stat.h:36:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t run_in_loop_peak_num = 0; //!< 等待任务数峰值 ^ /root/.tbox/include/tbox/event/stat.h:37:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t run_next_peak_num = 0; //!< 等待任务数峰值 ^ In file included from /root/.tbox/include/tbox/main/context.h:25:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/event/loop.h:43:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class Mode { ^ /root/.tbox/include/tbox/event/loop.h:51:38: error: ‘chrono’ in namespace ‘std’ does not name a type virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:59: error: expected unqualified-id before ‘&’ token virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:59: error: expected ‘)’ before ‘&’ token /root/.tbox/include/tbox/event/loop.h:51:46: error: expected ‘;’ at end of member declaration virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:104: error: ISO C++ forbids declaration of ‘wait_time’ with no type [-fpermissive] virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:104: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 /root/.tbox/include/tbox/event/loop.h:51:104: error: expected ‘;’ at end of member declaration /root/.tbox/include/tbox/event/loop.h:51:105: error: expected unqualified-id before ‘)’ token virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ /root/.tbox/include/tbox/event/loop.h:60:11: error: expected nested-name-specifier before ‘RunId’ using RunId = uint64_t; ^ /root/.tbox/include/tbox/event/loop.h:61:11: error: expected nested-name-specifier before ‘Func’ using Func = std::function<void()>; ^ /root/.tbox/include/tbox/event/loop.h:85:13: error: ‘RunId’ does not name a type virtual RunId runInLoop(Func &&func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:86:13: error: ‘RunId’ does not name a type virtual RunId runInLoop(const Func &func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:87:13: error: ‘RunId’ does not name a type virtual RunId runNext(Func &&func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:88:13: error: ‘RunId’ does not name a type virtual RunId runNext(const Func &func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:89:13: error: ‘RunId’ does not name a type virtual RunId run(Func &&func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:90:13: error: ‘RunId’ does not name a type virtual RunId run(const Func &func, const std::string &what = "") = 0; ^ /root/.tbox/include/tbox/event/loop.h:91:26: error: ‘RunId’ has not been declared virtual bool cancel(RunId run_id) = 0; ^ /root/.tbox/include/tbox/event/loop.h:106:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds wake_delay; //!< loop 唤醒延迟 ^ /root/.tbox/include/tbox/event/loop.h:107:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds loop_cost; //!< loop 时间消耗 ^ /root/.tbox/include/tbox/event/loop.h:108:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds event_cb_cost; //!< 事件回调时间消耗 ^ /root/.tbox/include/tbox/event/loop.h:109:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds run_cb_cost; //!< Run回调时间消耗 ^ /root/.tbox/include/tbox/event/loop.h:110:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds run_in_loop_delay; //!< runInLoop() 执行延迟 ^ /root/.tbox/include/tbox/event/loop.h:111:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds run_next_delay; //!< runNext() 执行延迟 ^ /root/.tbox/include/tbox/event/loop.h:112:12: error: ‘chrono’ in namespace ‘std’ does not name a type std::chrono::nanoseconds timer_delay; //!< 定时器延迟 ^ /root/.tbox/include/tbox/event/loop.h:49:38: error: ‘Mode’ is not a class or namespace virtual void runLoop(Mode mode = Mode::kForever) = 0; ^ /root/.tbox/include/tbox/event/loop.h:51:77: error: ‘std::chrono’ has not been declared virtual void exitLoop(const std::chrono::milliseconds &wait_time = std::chrono::milliseconds::zero()) = 0; ^ In file included from /root/.tbox/include/tbox/eventx/thread_pool.h:27:0, from /root/.tbox/include/tbox/main/context.h:26, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/base/cabinet_token.h:28:7: error: expected nested-name-specifier before ‘Id’ using Id = size_t; ^ /root/.tbox/include/tbox/base/cabinet_token.h:29:7: error: expected nested-name-specifier before ‘Pos’ using Pos = size_t; ^ /root/.tbox/include/tbox/base/cabinet_token.h:35:14: error: expected ‘)’ before ‘id’ Token(Id id, Pos pos) : id_(id), pos_(pos) { } ^ /root/.tbox/include/tbox/base/cabinet_token.h:37:12: error: ‘Id’ does not name a type inline Id id() const { return id_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:38:12: error: ‘Pos’ does not name a type inline Pos pos() const { return pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:57:5: error: ‘Id’ does not name a type Id id_ = 0; ^ /root/.tbox/include/tbox/base/cabinet_token.h:58:5: error: ‘Pos’ does not name a type Pos pos_ = 0; ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘void tbox::cabinet::Token::reset()’: /root/.tbox/include/tbox/base/cabinet_token.h:40:27: error: ‘id_’ was not declared in this scope inline void reset() { id_ = 0; pos_ = 0; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:40:36: error: ‘pos_’ was not declared in this scope inline void reset() { id_ = 0; pos_ = 0; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘bool tbox::cabinet::Token::isNull() const’: /root/.tbox/include/tbox/base/cabinet_token.h:41:41: error: ‘id_’ was not declared in this scope inline bool isNull() const { return id_ == 0; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘bool tbox::cabinet::Token::equal(const tbox::cabinet::Token&) const’: /root/.tbox/include/tbox/base/cabinet_token.h:43:58: error: ‘id_’ was not declared in this scope inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:43:71: error: ‘const class tbox::cabinet::Token’ has no member named ‘id_’ inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:43:78: error: ‘pos_’ was not declared in this scope inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:43:92: error: ‘const class tbox::cabinet::Token’ has no member named ‘pos_’ inline bool equal(const Token &other) const { return id_ == other.id_ && pos_ == other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘bool tbox::cabinet::Token::less(const tbox::cabinet::Token&) const’: /root/.tbox/include/tbox/base/cabinet_token.h:44:58: error: ‘id_’ was not declared in this scope inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:71: error: ‘const class tbox::cabinet::Token’ has no member named ‘id_’ inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:89: error: ‘const class tbox::cabinet::Token’ has no member named ‘id_’ inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:95: error: ‘pos_’ was not declared in this scope inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h:44:108: error: ‘const class tbox::cabinet::Token’ has no member named ‘pos_’ inline bool less(const Token &other) const { return id_ != other.id_ ? id_ < other.id_ : pos_ < other.pos_; } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘size_t tbox::cabinet::Token::hash() const’: /root/.tbox/include/tbox/base/cabinet_token.h:45:42: error: ‘id_’ was not declared in this scope inline size_t hash() const { return (id_ << 8) | (pos_ & 0xff); } ^ /root/.tbox/include/tbox/base/cabinet_token.h:45:55: error: ‘pos_’ was not declared in this scope inline size_t hash() const { return (id_ << 8) | (pos_ & 0xff); } ^ /root/.tbox/include/tbox/base/cabinet_token.h: In member function ‘tbox::cabinet::Token::operator bool() const’: /root/.tbox/include/tbox/base/cabinet_token.h:54:44: error: ‘id_’ was not declared in this scope inline operator bool () const { return id_ != 0; } ^ In file included from /root/.tbox/include/tbox/main/context.h:26:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/thread_pool.h: At global scope: /root/.tbox/include/tbox/eventx/thread_pool.h:47:11: error: expected nested-name-specifier before ‘TaskToken’ using TaskToken = cabinet::Token; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:67:11: error: expected nested-name-specifier before ‘NonReturnFunc’ using NonReturnFunc = std::function<void ()>; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:77:5: error: ‘TaskToken’ does not name a type TaskToken execute(NonReturnFunc &&backend_task, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:78:5: error: ‘TaskToken’ does not name a type TaskToken execute(const NonReturnFunc &backend_task, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:89:5: error: ‘TaskToken’ does not name a type TaskToken execute(NonReturnFunc &&backend_task, NonReturnFunc &&main_cb, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:90:5: error: ‘TaskToken’ does not name a type TaskToken execute(const NonReturnFunc &backend_task, const NonReturnFunc &main_cb, int prio = 0); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:92:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class TaskStatus { ^ /root/.tbox/include/tbox/eventx/thread_pool.h:99:30: error: ‘TaskToken’ has not been declared TaskStatus getTaskStatus(TaskToken task_token) const; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:110:16: error: ‘TaskToken’ has not been declared int cancel(TaskToken task_token); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:119:29: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t thread_num = 0; //!< 当前存活线程数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:120:34: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t idle_thread_num = 0; //!< 空闲线程数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:121:14: error: ‘array’ in namespace ‘std’ does not name a template type std::array<size_t, THREAD_POOL_PRIO_SIZE> undo_task_num; //! 各优先级等待任务数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:122:33: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t doing_task_num = 0; //!< 正在执行的任务数 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:123:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 size_t undo_task_peak_num = 0; //!< 等待任务数峰值 ^ /root/.tbox/include/tbox/eventx/thread_pool.h:130:11: error: expected nested-name-specifier before ‘ThreadToken’ using ThreadToken = cabinet::Token; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:132:21: error: ‘ThreadToken’ has not been declared void threadProc(ThreadToken thread_token); ^ /root/.tbox/include/tbox/eventx/thread_pool.h:142:16: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 Data *d_ = nullptr; ^ /root/.tbox/include/tbox/eventx/thread_pool.h:142:16: error: ‘nullptr’ was not declared in this scope In file included from /root/.tbox/include/tbox/main/context.h:27:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/timer_pool.h:39:11: error: expected nested-name-specifier before ‘TimerToken’ using TimerToken = cabinet::Token; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:40:11: error: expected nested-name-specifier before ‘Callback’ using Callback = std::function<void()>; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:41:11: error: expected nested-name-specifier before ‘Milliseconds’ using Milliseconds = std::chrono::milliseconds; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:42:11: error: expected nested-name-specifier before ‘TimePoint’ using TimePoint = std::chrono::system_clock::time_point; ^ In file included from /root/.tbox/include/tbox/eventx/timer_pool.h:28:0, from /root/.tbox/include/tbox/main/context.h:27, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/base/defines.h:38:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(const class_name&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:48:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:39:51: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (const class_name &) = delete ^ /root/.tbox/include/tbox/eventx/timer_pool.h:48:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:43:27: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:43:33: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:43:33: error: invalid constructor; you probably meant ‘tbox::eventx::TimerPool (const tbox::eventx::TimerPool&)’ class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:44:40: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ /root/.tbox/include/tbox/base/defines.h:44:46: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/eventx/timer_pool.h:49:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(TimerPool); ^ In file included from /root/.tbox/include/tbox/main/context.h:27:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/timer_pool.h:52:5: error: ‘TimerToken’ does not name a type TimerToken doEvery(const Milliseconds &m_sec, Callback &&cb); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:53:5: error: ‘TimerToken’ does not name a type TimerToken doAfter(const Milliseconds &m_sec, Callback &&cb); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:54:5: error: ‘TimerToken’ does not name a type TimerToken doAt(const TimePoint &time_point, Callback &&cb); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:59:23: error: ‘TimerToken’ does not name a type bool cancel(const TimerToken &token); ^ /root/.tbox/include/tbox/eventx/timer_pool.h:65:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 Impl *impl_ = nullptr; ^ /root/.tbox/include/tbox/eventx/timer_pool.h:65:19: error: ‘nullptr’ was not declared in this scope In file included from /root/.tbox/include/tbox/main/context.h:28:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/eventx/async.h:37:11: error: expected nested-name-specifier before ‘Callback’ using Callback = std::function<void(int)>; ^ /root/.tbox/include/tbox/eventx/async.h:38:11: error: expected nested-name-specifier before ‘StringCallback’ using StringCallback = std::function<void(int, std::string &)>; ^ /root/.tbox/include/tbox/eventx/async.h:39:11: error: expected nested-name-specifier before ‘StringVecCallback’ using StringVecCallback = std::function<void(int, std::vector<std::string> &)>; ^ /root/.tbox/include/tbox/eventx/async.h:41:48: error: ‘StringCallback’ has not been declared void readFile(const std::string &filename, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:41:63: error: expected ‘,’ or ‘...’ before ‘&&’ token void readFile(const std::string &filename, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:42:53: error: ‘StringVecCallback’ has not been declared void readFileLines(const std::string &filename, StringVecCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:42:71: error: expected ‘,’ or ‘...’ before ‘&&’ token void readFileLines(const std::string &filename, StringVecCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:44:101: error: ‘Callback’ has not been declared void writeFile (const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ /root/.tbox/include/tbox/eventx/async.h:44:110: error: expected ‘,’ or ‘...’ before ‘&&’ token void writeFile (const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = null ^ /root/.tbox/include/tbox/eventx/async.h:45:101: error: ‘Callback’ has not been declared void appendFile(const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ /root/.tbox/include/tbox/eventx/async.h:45:110: error: expected ‘,’ or ‘...’ before ‘&&’ token void appendFile(const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = null ^ /root/.tbox/include/tbox/eventx/async.h:47:50: error: ‘Callback’ has not been declared void removeFile(const std::string &filename, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:47:59: error: expected ‘,’ or ‘...’ before ‘&&’ token void removeFile(const std::string &filename, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:49:45: error: ‘Callback’ has not been declared void executeCmd(const std::string &cmd, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:49:54: error: expected ‘,’ or ‘...’ before ‘&&’ token void executeCmd(const std::string &cmd, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:50:45: error: ‘StringCallback’ has not been declared void executeCmd(const std::string &cmd, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:50:60: error: expected ‘,’ or ‘...’ before ‘&&’ token void executeCmd(const std::string &cmd, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:50:10: error: ‘void tbox::eventx::Async::executeCmd(const string&, int)’ cannot be overloaded void executeCmd(const std::string &cmd, StringCallback &&cb); ^ /root/.tbox/include/tbox/eventx/async.h:49:10: error: with ‘void tbox::eventx::Async::executeCmd(const string&, int)’ void executeCmd(const std::string &cmd, Callback &&cb = nullptr); ^ /root/.tbox/include/tbox/eventx/async.h:44:10: error: default argument missing for parameter 4 of ‘void tbox::eventx::Async::writeFile(const string&, const string&, bool, int)’ void writeFile (const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ /root/.tbox/include/tbox/eventx/async.h:45:10: error: default argument missing for parameter 4 of ‘void tbox::eventx::Async::appendFile(const string&, const string&, bool, int)’ void appendFile(const std::string &filename, const std::string &context, bool sync_now = false, Callback &&cb = n ^ In file included from /root/.tbox/include/tbox/terminal/terminal_nodes.h:23:0, from /root/.tbox/include/tbox/main/context.h:29, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/terminal/types.h:34:7: error: expected nested-name-specifier before ‘SessionToken’ using SessionToken = cabinet::Token; ^ /root/.tbox/include/tbox/terminal/types.h:35:7: error: expected nested-name-specifier before ‘NodeToken’ using NodeToken = cabinet::Token; ^ /root/.tbox/include/tbox/terminal/types.h:37:7: error: expected nested-name-specifier before ‘Args’ using Args = std::vector<std::string>; ^ /root/.tbox/include/tbox/terminal/types.h:38:7: error: expected nested-name-specifier before ‘Func’ using Func = std::function<void (const Session &s, const Args &)>; ^ In file included from /root/.tbox/include/tbox/terminal/terminal_nodes.h:24:0, from /root/.tbox/include/tbox/main/context.h:29, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/terminal/session.h:32:40: error: ‘SessionToken’ does not name a type Session(Connection *wp_conn, const SessionToken &st); ^ /root/.tbox/include/tbox/terminal/session.h:41:11: error: ‘SessionToken’ does not name a type const SessionToken st_; ^ In file included from /root/.tbox/include/tbox/main/context.h:29:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/terminal/terminal_nodes.h:35:13: error: ‘NodeToken’ does not name a type virtual NodeToken createFuncNode(const Func &func, const std::string &help = "") = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:37:13: error: ‘NodeToken’ does not name a type virtual NodeToken createDirNode(const std::string &help = "") = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:39:29: error: ‘NodeToken’ has not been declared virtual bool deleteNode(NodeToken node_token) = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:42:13: error: ‘NodeToken’ does not name a type virtual NodeToken rootNode() const = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:44:13: error: ‘NodeToken’ does not name a type virtual NodeToken findNode(const std::string &path) const = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:47:34: error: ‘NodeToken’ does not name a type virtual bool mountNode(const NodeToken &parent, const NodeToken &child, const std::string &name) = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:47:59: error: ‘NodeToken’ does not name a type virtual bool mountNode(const NodeToken &parent, const NodeToken &child, const std::string &name) = 0; ^ /root/.tbox/include/tbox/terminal/terminal_nodes.h:49:35: error: ‘NodeToken’ does not name a type virtual bool umountNode(const NodeToken &parent, const std::string &name) = 0; ^ In file included from /root/.tbox/include/tbox/main/context.h:30:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/coroutine/scheduler.h:33:7: error: expected nested-name-specifier before ‘RoutineToken’ using RoutineToken = cabinet::Token; ^ /root/.tbox/include/tbox/coroutine/scheduler.h:34:7: error: expected nested-name-specifier before ‘RoutineEntry’ using RoutineEntry = std::function<void(Scheduler&)>; ^ In file included from /root/.tbox/include/tbox/eventx/timer_pool.h:28:0, from /root/.tbox/include/tbox/main/context.h:27, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/base/defines.h:38:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(const class_name&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:46:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:39:51: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (const class_name &) = delete ^ /root/.tbox/include/tbox/coroutine/scheduler.h:46:5: note: in expansion of macro ‘NONCOPYABLE’ NONCOPYABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:43:27: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:43:33: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:43:33: error: invalid constructor; you probably meant ‘tbox::coroutine::Scheduler (const tbox::coroutine::Scheduler&)’ class_name(class_name &&) = delete; \ ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:44:40: error: expected ‘,’ or ‘...’ before ‘&&’ token class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ /root/.tbox/include/tbox/base/defines.h:44:46: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 class_name& operator = (class_name &&) = delete ^ /root/.tbox/include/tbox/coroutine/scheduler.h:47:5: note: in expansion of macro ‘IMMOVABLE’ IMMOVABLE(Scheduler); ^ In file included from /root/.tbox/include/tbox/main/context.h:30:0, from /root/.tbox/include/tbox/main/module.h:25, from app_main.cpp:1: /root/.tbox/include/tbox/coroutine/scheduler.h:51:5: error: ‘RoutineToken’ does not name a type RoutineToken create(const RoutineEntry &entry, ^ /root/.tbox/include/tbox/coroutine/scheduler.h:56:23: error: ‘RoutineToken’ does not name a type bool resume(const RoutineToken &token); //! 恢复指定协程 ^ /root/.tbox/include/tbox/coroutine/scheduler.h:57:23: error: ‘RoutineToken’ does not name a type bool cancel(const RoutineToken &token); //! 取消指定协程,只能给协程发送了取消请求,并非立 ^ /root/.tbox/include/tbox/coroutine/scheduler.h:63:21: error: ‘RoutineToken’ does not name a type bool join(const RoutineToken &other_routine); //! 一个协程等待另一个协程结束 ^ /root/.tbox/include/tbox/coroutine/scheduler.h:65:5: error: ‘RoutineToken’ does not name a type RoutineToken getToken() const; //! 获取当前协程token ^ /root/.tbox/include/tbox/coroutine/scheduler.h:83:16: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 Data *d_ = nullptr; ^ /root/.tbox/include/tbox/coroutine/scheduler.h:83:16: error: ‘nullptr’ was not declared in this scope In file included from /root/.tbox/include/tbox/main/module.h:25:0, from app_main.cpp:1: /root/.tbox/include/tbox/main/context.h:45:18: error: ‘chrono’ in namespace ‘std’ does not name a type virtual std::chrono::milliseconds running_time() const = 0; ^ /root/.tbox/include/tbox/main/context.h:46:18: error: ‘chrono’ in namespace ‘std’ does not name a type virtual std::chrono::system_clock::time_point start_time_point() const = 0; ^ In file included from app_main.cpp:1:0: /root/.tbox/include/tbox/main/module.h:74:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class State { ^ In file included from app_main.cpp:1:0: /root/.tbox/include/tbox/main/module.h:99:28: error: ‘Json’ has not been declared void fillDefaultConfig(Json &js_parent); ^ /root/.tbox/include/tbox/main/module.h:100:27: error: ‘Json’ does not name a type bool initialize(const Json &js_parent); ^ /root/.tbox/include/tbox/main/module.h:113:38: error: ‘Json’ has not been declared virtual void onFillDefaultConfig(Json &js_this) { (void)js_this; } ^ /root/.tbox/include/tbox/main/module.h:115:31: error: ‘Json’ does not name a type virtual bool onInit(const Json &js_this) { (void)js_this; return true; } ^ /root/.tbox/include/tbox/main/module.h:132:27: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 State state_ = State::kNone; ^ /root/.tbox/include/tbox/main/module.h:132:20: error: ‘State’ is not a class or namespace State state_ = State::kNone; ^ <builtin>: recipe for target 'app_main.o' failed make: *** [app_main.o] Error 1 ``` 在makefile中增加c++11的要求后通过编译 ``` TARGET:=demo OBJECTS:=app_main.o CXXFLAGS:=-I$(HOME)/.tbox/include -std=c++11 LDFLAGS:=-L$(HOME)/.tbox/lib -rdynamic LIBS:=\ -ltbox_main \ -ltbox_coroutine \ -ltbox_trace \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ -ltbox_event \ -ltbox_log \ -ltbox_util \ -ltbox_base \ -lpthread -ldl $(TARGET): $(OBJECTS) g++ -o $@ $^ $(LDFLAGS) $(LIBS) ```
评论 (
0
)
mojinpan
创建了
任务
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
未关联
master
develop
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
1
https://gitee.com/cpp-master/cpp-tbox-tutorials.git
[email protected]
:cpp-master/cpp-tbox-tutorials.git
cpp-master
cpp-tbox-tutorials
cpp-tbox-tutorials
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册