【发布时间】:2018-08-14 22:58:19
【问题描述】:
按照 AWS 指南:https://aws.amazon.com/blogs/iot/how-to-bridge-mosquitto-mqtt-broker-to-aws-iot/,我开始安装 mosquitto。
//Update the list of repositories with one containing Mosquitto
sudo wget http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/home:oojah:mqtt.repo -O /etc/yum.repos.d/mqtt.repo
//Install Mosquitto broker and Mosquitto command line tools
sudo yum install mosquitto mosquitto-clients
但是,该指南已经过时了,以至于它没有提到任何关于缺少的 libwebsockets 库的信息。我花了大约 4-5 个小时来寻找有关如何手动安装/链接/设置库的答案,但我无法使任何工作。
(1) 试过这个git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=/usr/bin/gcc
make
sudo make install
但是是的,这不起作用,因为 CMAKE 会抛出各种错误,例如
CMake Error at /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:99 (message): Could not find toolchain file: /tmp/mytoolchainfile
Call Stack (most recent call first):
CMakeLists.txt:131 (project)
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Could not find cmake module file: /tmp/libwebsockets/build/CMakeFiles/2.8.12.2/CMakeCCompiler.cmake
-- Configuring incomplete, errors occurred!
所以我尝试将 CMAKE_C_COMPILER 路径设置为 /usr/bin/gcc,这是安装编译器的位置,但也没有执行任何操作。老实说,我对 Linux 不是很熟悉,我只是想尽我所能。我真的可以使用一些关于如何最好地安装库并将其链接到 Linux 的指导。我确实相信 AWS 运行的是红帽版本的 linux。
感谢您的宝贵时间!
【问题讨论】:
标签: linux amazon-web-services cmake mqtt libwebsockets