diff --git a/README.md b/README.md index 53115becbc7fa962391d5489670ac61b94b5fb82..07d534f0851ff6154ee7bfb6efa8f5996291f772 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,10 @@ cpp\_tbox,全称: C++ Treasure Box,C++开发百宝箱,是基于事件的 | 库名 | 依赖模块 | 说明 | 安装方法 | |:----:|:--------:|:----:|:--------:| | googletest | 所有模块 | 单元测试用,如果不进行单元测试可忽略 | sudo apt install google-mock | -| libevent | event | 在event/config.mk中开启了WITH\_LIBEVENT时依赖 | sudo apt install libevent-dev | -| libev | event | 在event/config.mk中开启了WITH\_LIBEV时依赖 | sudo apt install libev-dev | -| mosquitto | mqtt | MQTT client库 | sudo apt install libmosquitto-dev | -| nlohmann/json | main | 作为配置数据用 | 下载json\_fwd.hpp与json.hpp 到/usr/local/include/nlohmann/。[json\_fwd.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/include/nlohmann/json_fwd.hpp), [json.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/single_include/nlohmann/json.hpp) | +| libevent | event | 默认不依赖,在event/config.mk中开启了WITH\_LIBEVENT时依赖 | sudo apt install libevent-dev | +| libev | event | 默认不依赖,在event/config.mk中开启了WITH\_LIBEV时依赖 | sudo apt install libev-dev | +| mosquitto | mqtt | MQTT库 | sudo apt install libmosquitto-dev | +| nlohmann/json | main | 作为配置数据用 | 下载[json\_fwd.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/include/nlohmann/json_fwd.hpp)与[json.hpp](https://raw.githubusercontent.com/nlohmann/json/v3.10.4/single_include/nlohmann/json.hpp)到头文件目录,如:/usr/local/include/nlohmann/ | **安装命令** diff --git a/main/example/00_empty/Makefile b/main/example/00_empty/Makefile index 7bba09d02fb0b9e46b100a4916c8ae8cfc0a0264..6bdfcde406d66b06f8d22941cc3017bf07d75bfa 100644 --- a/main/example/00_empty/Makefile +++ b/main/example/00_empty/Makefile @@ -6,6 +6,7 @@ TARGET := sample CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/01_one_app/Makefile b/main/example/01_one_app/Makefile index 6f476699763ef37019bacc34bf3f34ed896c4813..577137db66bfca1b12eb2c8ad68a02438d6afc5d 100644 --- a/main/example/01_one_app/Makefile +++ b/main/example/01_one_app/Makefile @@ -6,6 +6,7 @@ TARGET := sample CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/02_more_than_one_apps/Makefile b/main/example/02_more_than_one_apps/Makefile index e40bc7857987f3c811a0434c1250e8c5dbbaa647..92b8ff5af6fa254db2d3c33cf4689f85e3bb3a54 100644 --- a/main/example/02_more_than_one_apps/Makefile +++ b/main/example/02_more_than_one_apps/Makefile @@ -12,6 +12,7 @@ include app3/app.mk CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/03_nc_client_and_echo_server/Makefile b/main/example/03_nc_client_and_echo_server/Makefile index 840f9033ab8242459afe9a06f2c3b12a63a13ce6..3b9206c5eaafeca2165a9173c454c8402f0d8eae 100644 --- a/main/example/03_nc_client_and_echo_server/Makefile +++ b/main/example/03_nc_client_and_echo_server/Makefile @@ -11,6 +11,7 @@ include echo_server/app.mk CXXFLAGS += -ggdb -DLOG_MODULE_ID='"demo"' LDFLAGS += -L.. \ -ltbox_main \ + -ltbox_log \ -ltbox_terminal \ -ltbox_network \ -ltbox_eventx \ diff --git a/main/example/03_nc_client_and_echo_server/echo_server/app.cpp b/main/example/03_nc_client_and_echo_server/echo_server/app.cpp index bc556e85fb746237eebd62b69fc5366bfad4706a..05591ac4c7216ee190a7300f2792377aa5e92c8c 100644 --- a/main/example/03_nc_client_and_echo_server/echo_server/app.cpp +++ b/main/example/03_nc_client_and_echo_server/echo_server/app.cpp @@ -31,7 +31,7 @@ bool App::onInit(const tbox::Json &cfg) if (!js_bind.is_string()) return false; - if (!server_->initialize(SockAddr::FromString(js_bind.get()))) + if (!server_->initialize(SockAddr::FromString(js_bind.get()), 2)) return false; server_->setReceiveCallback(