1、需要安装cmake,需要高版本的,去官网下载最新的版本:http://www.cmake.org; | 若已经安装,删除原有的cmake:sudo apt remove cmake |
2、安装cmake过程遇到的困难:
(1)需要安装基本的环境:sudo apt-get install build-essential;
(2)执行./bootstrap时遇到问题:
-- Looking for gethostname
-- Looking for gethostname - found
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
CMake Error at Utilities/cmcurl/CMakeLists.txt:454 (message):
Could not find OpenSSL. Install an OpenSSL development package or
configure CMake with -DCMAKE_USE_OPENSSL=OFF to build without OpenSSL.
-- Configuring incomplete, errors occurred!
See also "/home/whlg/cmake-3.16.6/CMakeFiles/CMakeOutput.log".
See also "/home/whlg/cmake-3.16.6/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
解决办法:sudo apt-get install libssl-dev
(3)make
(4)sudo make install
(5)查看当前版本:cmake -version
(6)若出现“bash: /usr/bin/cmake: 没有那个文件或目录”,参照下一步建立软链接
(7)sudo ln -s /usr/local/bin/cmake /usr/bin
(8)若有遇到:“Compile error: Cannot find a C++ compiler that supports both C++11 and the specified C++ flags”,执行:sudo apt-get install g++
以上内容参考博客:https://www.cnblogs.com/jsdy/p/12689470.html#_label1_0,对博主分享表示感谢!
3、安装Jthread
(1)cmake CMakeLists.txt
(2)make
(3)sudo make install
4、安装jrtplib
(1)cmake CMakeLists.txt
(2)make
(3)sudo make install
5、查看安装的文件:
(1) /usr/local/lib 目录下放置着编译的jrtplib和jthread的库
(2)/usr/local/incude 多了两个文件夹:jrtplib3 jthread
整体流程参考博客:https://www.cnblogs.com/yuweifeng/p/7550737.html,对博主的帮助表示感谢!
文中用到的文件,可以到下面链接免费下载(已经设置积分为0):