linux 源码编译安装 openresty
一、下载安装 openresty 是一个基于 nginx 和 lua 的高性能 web 框架。 官方首页:https://openresty.org/cn/。 下载首页:https://openresty.org/cn/download.html,当前最新版为 1.13.6.2 。 依赖库: ubuntu: apt- ... 阅读更多
一、下载安装 openresty 是一个基于 nginx 和 lua 的高性能 web 框架。 官方首页:https://openresty.org/cn/。 下载首页:https://openresty.org/cn/download.html,当前最新版为 1.13.6.2 。 依赖库: ubuntu: apt- ... 阅读更多
编译 lua 的时候报错头文件找不到:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@centos lua-5.3.4]# make linux test cd src && make linux make[1]: Entering directory `/home/ma/software/lua-5.3.4/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" make[2]: Entering directory `/home/ma/software/lua-5.3.4/src' gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c lua.c:82:31: error: readline/readline.h: No such file or directory lua.c:83:30: error: readline/history.h: No such file or directory lua.c: In function 『pushline』: lua.c:312: warning: implicit declaration of function 『readline』 lua.c:312: warning: assignment makes pointer from integer without a cast lua.c: In function 『addreturn』: lua.c:339: warning: implicit declaration of function 『add_history』 make[2]: *** [lua.o] Error 1 make[2]: Leaving directory `/home/ma/software/lua-5.3.4/src' make[1]: *** [linux] Error 2 make[1]: Leaving directory `/home/ma/software/lua-5.3.4/src' make: *** [linux] Error 2 |
解决方法
|
1 2 3 4 |
# centos yum install readline-devel # debian apt-get install libreadline-dev. |
换新电脑了,以前的笔记本装了 ubuntu 用来开发使用,虽然是独立的物理机系统,但是还是习惯在本机远程登陆。一来为了省电,二来为了不那么占位置,所以就把盖子直接给关了。 默认情况下,盖上盖子会使系统进入休眠状态,远程连接也将被断掉。 如果想不休眠,需要进行以下修改: [crayon-694a45e1e ... 阅读更多
MTU: Maximum transmission unit,最大传输单元,IP 报文段的最大大小。 MSS: Maximum segment size,最大的帧大小,是 TCP 数据段的最大大小。 其中 MTU 工作于数据链路层,取决于网络环境。而 MSS 只是 TCP 负载部分的大小,它受限于 MTU 。要注意的是 M ... 阅读更多
STL 中的 string 类有两个方法 size() 和 length() 用来返回字符串的长度。 两者在实现上没有区别:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
> sed -n 907,918p /usr/include/c++/7/bits/basic_string.h // Capacity: /// Returns the number of characters in the string, not including any /// null-termination. size_type size() const _GLIBCXX_NOEXCEPT { return _M_string_length; } /// Returns the number of characters in the string, not including any /// null-termination. size_type length() const _GLIBCXX_NOEXCEPT { return _M_string_length; } |