我是一个(绝对)使用libwebsocket(和cmake)的初学者,我正在尝试从libwebsockets.org构建一个最小的示例:
"lws minimal ws server + permessage-deflate echo"
在…
https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/ws-server/minimal-ws-server-echo
我已经安装了libwebsockets dev (sudo apt install Libwebsockets Dev)和cmake (sudo apt install cmake)。
示例页面告诉我使用以下命令构建示例(两个.c文件和CMakeLists.txt)
$ cmake . && make
构建失败,并显示以下消息:
CMake Error at CMakeLists.txt:3 (find_package):
Could not find a package configuration file provided by "libwebsockets"
with any of the following names:
libwebsocketsConfig.cmake
libwebsockets-config.cmake
Add the installation prefix of "libwebsockets" to CMAKE_PREFIX_PATH or set
"libwebsockets_DIR" to a directory containing one of the above files. If
"libwebsockets" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
See also "/home/user/ws/CMakeFiles/CMakeOutput.log".
我在系统中找不到这两个.cmake文件(它们显然不是作为libwebsockets dev包的一部分提供的)。
我遗漏了什么?
谢谢!
发布于 2020-08-27 06:09:58
谢谢你,Tsyvarev,你是对的。
解决方案是从github仓库构建libwebsocket,而不是从ubuntu 18.04安装的libwebsocket-dev。
https://stackoverflow.com/questions/63585787
复制相似问题