Skip to content
April edited this page Aug 31, 2021 · 17 revisions
  • 编译 lua 时,因为找不到 readline/readline.h 等出错怎么办?
  • How to fix readline/readline.h not found error when compiling Lua?

仔细阅读 http://www.lua.org/manual/5.3/readme.html ,然后确保你安装了 readline 的开发库。

Read this manual carefully: http://www.lua.org/manual/5.3/readme.html and make sure you have installed readline dev lib.

  • 编译 jemalloc 时出错怎么办?
  • How to fix jemalloc compiling error?

jemalloc 是用 git submodule 模式引用,安装 git 确保 make 可以自动更新到 jemalloc 仓库。或自行下载 jemalloc 复制到对应目录 3rd/jemalloc 下。且编译 jemalloc 需要安装 autoconf 。如果还嫌麻烦,参考 platform.mk 里 macosx 的写法,定义宏来取消 jemalloc 。

jemalloc uses git submodule mode for reference, install git and make sure make can be automatically updated to jemalloc repository. Or download jemalloc manually and put it in the directory: 3rd/jemalloc, and to compile jemalloc it also requires installing autoconf. If these are too complicated for you, check the solution of macosc in platform.mk, use macro to disable jemalloc.

  • 下载的 zip file 或 tar ball 解开后编译不了?
  • Why doesn't the package compile successfully from zip file or using tar ball.

github 无法自动打包 submoudle ,所以你需要自行下载缺失的部分。见上一条:编译 jemalloc 时出错怎么办?

github doesn't pack submodule automatically, you need to install the missing part on your own. Please refer to the solution of "How to fix jemalloc compiling error?".

  • skynet 有 Windows 版么?
  • Does Skynet have a Windows version?

不会有官方的 Windows 版,如果你希望在 Windows 下开发,请安装 Linux 虚拟机环境。非官方 Windows 版可以寻求社区支持,或自己做一个。例如:skynet-mingw ,它的主要特点是没有修改skynet的源代码,仅通过修改编译选项支持了windows。 Win10的子系统linux的bash可以编译成功。开启子系统方法自行百度= =。

There won't be an official Windows version, if you want to develop on Windows, please install a Linux VM environment. Check the community forum for the unofficial Windows version or develop your own version. For example skynet-mingw, the main pros are that it doesn't change Skynet source code and only changes the compiling configuration to support Windows. Linux bash subsystem on Win10 can be used to compile it. Please search for how to enable subsystem.

  • 运行 lua examples/client.lua 出错?
  • How to fix lua examples/client.lua error?

确保你使用的是 Lua 5.3 以上版本。

Make sure you are using Lua 5.3 or above.

或者使用 ./3rd/lua/lua examples/client.lua 运行客户端。

Or use ./3rd/lua/lua examples/client.lua to run a client.

  • 在 skynet.lua 中,require "skynet.core" 引用的库为什么找不到对应的代码?
  • In skynet.lua, it uses require "skynet.core", why there is no corresponding code for that lib?

请阅读 Lua 的文档,然后在 C 代码中 grep luaopen_skynet_core

Please read Lua document, and search C code with the command: grep luaopen_skynet_core.

  • 如何运行 test/ 下的 lua 脚本?
  • How to run the Lua script in test/ folder?

test/ 下的 lua 脚本不能使用 lua 解释器直接运行。需要先启动 skynet ,用 skynet 加载它们。如果打开了 console ,这时应该可以在控制台输入一些字符。输入脚本的名字(不带 .lua)即可加载。如果打开了 debug_console 可以用 telnet 连接上 127.0.0.1:8000 。然后试着输入 help ,学会怎样加载脚本。

Lua scripts in test/ cannot be run with Lua interpreter directly. Please start Skynet and use it to load them. If you open a console, you should be able to type some commands there and input the name of the script (without the .lua postfix) to load the test script. If debug_console is running, use telnet to connect to 127.0.0.1:8000, then try help command to learn how to load scripts.

  • freebsd10下make报错Need an operator?
  • How to fix Need an operator error when run make command on freebsd10 or below?

安装gmake,使用gmake编译。

Please install gmake and use gamke to compile.

  • skynet 支持 https 吗?
  • Does Skynet support HTTPS?

默认只支持 http,但是你可以在 Makefile 中打开 TLS_MODULE=ltls 就可以加入 https 支持。但需要额外依赖 openssl 库,请自行安装,并正确设置 TLS_LIBTLS_INC。同时,你需要在 Config 文件中增加一行 enablessl = true

It supports HTTP only by default, however, you can edit Makefile and enable TLS_MODULE=ltls to support HTTPS. It requires OpenSSL lib, please install it yourself, and set TLS_LIB, TLS_INC correctly. Also, you need to add enablessl = true in Config file.

Clone this wiki locally