Ubuntu20.04安装cpp_redis

C++使用Redis安装问题记录

安装过程遇到一些问题,做一个记录方便自己后续查看

apt-get install libboost-all-dev libhiredis-dev #不清楚是否必要
git clone --recursive https://github.com/luca3m/cpp_redis.git #不加--recursive的话,tacopie目录下没东西
cd cpp_redis
mkdir build
cd build
cmake ..
make 
make install

在cmake … 这个步骤出现问题

CMake Error: install(EXPORT "cpp_redis" ...) includes target "cpp_redis" which requires target "tacopie" that is not in any export set.
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

将cpp_redis/CMakeLists.txt 发给ai,根据ai的回答修改如下:

> #找到install 命令的部分,确保 tacopie 也被包含在导出集中:
> install(TARGETS ${PROJECT_NAME} tacopie EXPORT ${EXPORT_TARGET_NAME}
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) 

> install(EXPORT ${EXPORT_TARGET_NAME} DESTINATION
> ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} FILE ${PROJECT_NAME}-targets.cmake)
if (NOT tacopie_library AND NOT USE_CUSTOM_TCP_CLIENT)
  # requires CMP0077 set to NEW
  set(BUILD_EXAMPLES OFF)
  set(BUILD_TESTS OFF)
  add_subdirectory(tacopie)
  # TODO: add alias library 下面set是额外添加的部分
  set(tacopie_library tacopie)
endif ()

之后make步骤出现问题
fatal error: tacopie/tacopie: No such file or directory

###
# includes
###
target_include_directories(${PROJECT_NAME} PUBLIC
  $<BUILD_INTERFACE:${cpp_redis_includes}>
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tacopie/includes>
  $<INSTALL_INTERFACE:include>)

按上面的找到include部分,添加一条$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tacopie/includes>

➜ NodeJS # 1. 备份重要数据 e/NodeJS-backup # 2. 更新当前系统 ➜ NodeJS sudo cp -r /workspace/NodeJS /workspace/NodeJS-backup do apt upgrade -y # 3. 安装升级工具 sudo apt install update-manager-core -y # 4. 执行发行版升级 sudo do-release-upgrade ➜ NodeJS ➜ NodeJS # 2. 更新当前系统 ➜ NodeJS sudo apt update && sudo apt upgrade -y Hit:1 http://mirrors.tencentyun.com/ubuntu focal InRelease Hit:2 http://mirrors.tencentyun.com/ubuntu focal-updates InRelease Hit:3 http://mirrors.tencentyun.com/ubuntu focal-backports InRelease Hit:4 http://mirrors.tencentyun.com/ubuntu focal-security InRelease Hit:5 https://download.docker.com/linux/ubuntu focal InRelease Hit:6 https://packages.redis.io/deb focal InRelease Hit:7 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease Ign:8 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease Err:9 http://apt.postgresql.org/pub/repos/apt focal-pgdg Release 404 Not Found [IP: 198.18.0.8 80] Hit:10 https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 InRelease Reading package lists... Done E: The repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. ➜ NodeJS ➜ NodeJS # 3. 安装升级工具 ➜ NodeJS sudo apt install update-manager-core -y Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libboost-filesystem1.71.0 libboost-iostreams1.71.0 libboost-program-options1.71.0 libgoogle-perftools4 libhiredis0.14 libjemalloc2 liblua5.1-0 libpcap0.8 libsnappy1v5 libtcmalloc-minimal4 libunwind8 libyaml-cpp0.6 lua-bitop lua-cjson Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: distro-info python3-distro-info python3-distupgrade python3-update-manager python3-yaml ubuntu-advantage-tools ubuntu-pro-client ubuntu-pro-client-l10n ubuntu-release-upgrader-core Suggested packages: shunit2 python3-launchpadlib The following NEW packages will be installed: distro-info python3-distro-info python3-distupgrade python3-update-manager python3-yaml ubuntu-advantage-tools ubuntu-pro-client ubuntu-pro-client-l10n ubuntu-release-upgrader-core update-manager-core 0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Need to get 603 kB of archives. After this operation, 3,696 kB of additional disk space will be used. Get:1 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 python3-yaml amd64 5.3.1-1ubuntu0.1 [136 kB] Get:2 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 distro-info amd64 0.23ubuntu1.1 [17.1 kB] Get:3 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 ubuntu-pro-client amd64 36ubuntu0~20.04 [236 kB] Get:4 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 ubuntu-advantage-tools all 36ubuntu0~20.04 [11.0 kB] Get:5 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 ubuntu-pro-client-l10n amd64 36ubuntu0~20.04 [18.7 kB] Get:6 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 python3-distro-info all 0.23ubuntu1.1 [5,944 B] Get:7 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 python3-update-manager all 1:20.04.10.23 [38.5 kB] Get:8 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 python3-distupgrade all 1:20.04.41 [105 kB] Get:9 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 ubuntu-release-upgrader-core all 1:20.04.41 [24.3 kB] Get:10 http://mirrors.tencentyun.com/ubuntu focal-updates/main amd64 update-manager-core all 1:20.04.10.23 [11.6 kB] Fetched 603 kB in 0s (4,465 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package python3-yaml. (Reading database ... 38118 files and directories currently installed.) Preparing to unpack .../0-python3-yaml_5.3.1-1ubuntu0.1_amd64.deb ... Unpacking python3-yaml (5.3.1-1ubuntu0.1) ... Selecting previously unselected package distro-info. Preparing to unpack .../1-distro-info_0.23ubuntu1.1_amd64.deb ... Unpacking distro-info (0.23ubuntu1.1) ... Selecting previously unselected package ubuntu-pro-client. Preparing to unpack .../2-ubuntu-pro-client_36ubuntu0~20.04_amd64.deb ... Unpacking ubuntu-pro-client (36ubuntu0~20.04) ... Selecting previously unselected package ubuntu-advantage-tools. Preparing to unpack .../3-ubuntu-advantage-tools_36ubuntu0~20.04_all.deb ... Unpacking ubuntu-advantage-tools (36ubuntu0~20.04) ... Selecting previously unselected package ubuntu-pro-client-l10n. Preparing to unpack .../4-ubuntu-pro-client-l10n_36ubuntu0~20.04_amd64.deb ... Unpacking ubuntu-pro-client-l10n (36ubuntu0~20.04) ... Selecting previously unselected package python3-distro-info. Preparing to unpack .../5-python3-distro-info_0.23ubuntu1.1_all.deb ... Unpacking python3-distro-info (0.23ubuntu1.1) ... Selecting previously unselected package python3-update-manager. Preparing to unpack .../6-python3-update-manager_1%3a20.04.10.23_all.deb ... Unpacking python3-update-manager (1:20.04.10.23) ... Selecting previously unselected package python3-distupgrade. Preparing to unpack .../7-python3-distupgrade_1%3a20.04.41_all.deb ... Unpacking python3-distupgrade (1:20.04.41) ... Selecting previously unselected package ubuntu-release-upgrader-core. Preparing to unpack .../8-ubuntu-release-upgrader-core_1%3a20.04.41_all.deb ... Unpacking ubuntu-release-upgrader-core (1:20.04.41) ... Selecting previously unselected package update-manager-core. Preparing to unpack .../9-update-manager-core_1%3a20.04.10.23_all.deb ... Unpacking update-manager-core (1:20.04.10.23) ... Setting up distro-info (0.23ubuntu1.1) ... Setting up python3-yaml (5.3.1-1ubuntu0.1) ... Setting up python3-distro-info (0.23ubuntu1.1) ... Setting up ubuntu-pro-client (36ubuntu0~20.04) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.) debconf: falling back to frontend: Readline Created symlink /etc/systemd/system/multi-user.target.wants/ua-reboot-cmds.service → /lib/systemd/system/ua-reboot-cmds.service. Created symlink /etc/systemd/system/timers.target.wants/ua-timer.timer → /lib/systemd/system/ua-timer.timer. Created symlink /etc/systemd/system/multi-user.target.wants/ubuntu-advantage.service → /lib/systemd/system/ubuntu-advantage.service. Setting up ubuntu-pro-client-l10n (36ubuntu0~20.04) ... Setting up ubuntu-advantage-tools (36ubuntu0~20.04) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.) debconf: falling back to frontend: Readline Setting up python3-update-manager (1:20.04.10.23) ... Setting up python3-distupgrade (1:20.04.41) ... Setting up ubuntu-release-upgrader-core (1:20.04.41) ... Setting up update-manager-core (1:20.04.10.23) ... Processing triggers for man-db (2.9.1-1) ...
最新发布
11-13
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值