在入门llvm的时候碰倒了各种错误,记录一下,也为其他人提供参考
环境:
主机WIN10+虚拟机vmware + ubuntu18.04 amd架构

ll@ubuntu:~/src/llvm-project-main/build$ cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../llvm
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:49 (project):No CMAKE_CXX_COMPILER could be found.Tell CMake where to find the compiler by setting either the environmentvariable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full pathto the compiler, or to the compiler name if it is in the PATH.-- Configuring incomplete, errors occurred!

我初次装cmake需要安装g++,那就安装把

sudo apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:g++ : Depends: g++-7 (>= 7.3.0-12~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

安装失败,g++依赖g++ - 7,那再安装g++ - 7

sudo apt-get install g++-7
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:g++-7 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installedDepends: gcc-7 (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installedDepends: libstdc++-7-dev (= 7.3.0-16ubuntu3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages

·g++-7又依赖这些东西,这些东西安装不了,因为系统本身已经安装了这些包,导致版本不兼容,我的解决方案就是把他们全都卸载掉,重新让apt自己安装。

sudo apt-get remove gcc-7
sudo apt-get remove libstdc++-7-dev
sudo apt-get remove gcc-7-base

再次安装g++

sudo apt-get install g++

这时apt会自己找兼容的版本,,也可以先配置一个国内的源,要不安装的时候会有点慢。

安装g++时出现的一种报错及解决方案相关推荐

  1. 安装haxm时遇到的三种报错及解决措施

    安装Android Studio时遇到这样的报错,花了一整天才解决掉,基本翻遍了CSDN上的所有相关文章,步骤如下: 检查错误原因参考文章1 这一步需要我们找到haxm的安装日志,路径在c盘里,具体如 ...

  2. Autopep8 安装时出现的两种报错 failed to create process 和 [Errno 2] No such file or directory

    Autopep8 安装时出现的两种报错 1.failed to create process 2.[Errno 2] No such file or directory 小结 关键词: autopep ...

  3. 安装Phoenix时,执行./splline.py报错File “./sqlline.py“, line 25, in <module> import phoenix_utils File

    安装Phoenix时,执行./splline.py报错File "./sqlline.py", line 25, in <module> import phoenix_ ...

  4. 关于Win11安装Anaconda弹出Navigator Error网页报错的解决方案

    关于Win11安装Anaconda弹出Navigator Error网页报错的解决方案 前言 昨晚因为电脑故障要重装系统,脑子一抽就升级了Win11. 本来倒也没什么,基本上所有的软件都安装完了,但在 ...

  5. 安装WSL2时遇到的问题(0x80370102报错)解决

    因为更新了win11,wsl终于在资源管理器中可以看到,所以就想玩一玩 先来简单提一句啥是WSL(适用于 Linux 的 Windows 子系统) 适用于 Linux 的 Windows 子系统可让开 ...

  6. Ubuntu16.04安装ROS时,sudo rosdep init报错,Error: cannot download default sources list from:

    安装ROS时需要安装rosdep,但是由于外网访问不了,所以访问不了https://raw.githubusercontent.com/网站.因此在执行sudo rosdep init这一步时,会提示 ...

  7. ./configure时出现PKG_PROG_PKG_CONFIG和PKG_CHECK_MODULES报错的解决方案

    本人在 ubuntu18.04 虚机编译 riscv-openocd 时遇到了一些 pkg-config 相关的问题,现总结分享出来,给有需要的人提供一个可参考的解决方案. riscv-openocd ...

  8. 安装cuda时出现 non 7z achive. 报错解决办法 安装文件损坏

    安装CUDA9.0时,运行cuda_9.0.176_win10.176_win10-exe.exe出现: 原因:CUDA安装文件损坏 解决方法: 重新下一个 链接:CUDA Toolkit Archi ...

  9. ROS的 sudo rosdep init 的报错终极解决方案

    ROS的 sudo rosdep init 的报错解决方案 安装ROS时sudo rosdep init指令报错: ERROR: cannot download default sources lis ...

最新文章

  1. 你所未知的人工智能应用领域
  2. Button的使用(三):处理点击事件
  3. c# 爬虫 -ChromeDriver+HtmlAgilityPack爬取比赛实时比分
  4. @Transactional 事务失效记录
  5. php refcount,php的函数的形参refcount为何要加2
  6. bgb邻居关系建立模型_今日 Paper | 新闻推荐系统;多路编码;知识增强型预训练模型等...
  7. EMNLP杰出论文 | 当注意力遇到RNN,五倍以上训练加速!
  8. 点击IE窗口上方的“X关闭符号”,弹出提示窗口!
  9. spring cloud 搭建问题记录
  10. Unix 环境高级编程 之 理解 rws 权限
  11. 初见Autorun病毒与解决办法
  12. 水平居中设置-定宽块状元素
  13. 秘密secret的几个应用场景
  14. 深切悼念JAVA培训界第一人张孝祥老师意外辞世
  15. c#:mvc单选按钮(性别)
  16. 华为 OSPF基本概念与基础配置
  17. 转载 如何用示波器进行UART串口数据分析
  18. 金融学具体包括什么专业,就业方向?
  19. 14-luogu-P1308 [NOIP2011 普及组] 统计单词数
  20. java编写日历思路_使用JAVA写一个简单的日历

热门文章

  1. 2019年3月最新windwows101809教育版激活密钥及其下载地址
  2. 3.5 使用螺旋线工具绘制蜗牛螺纹 [Illustrator CC教程]
  3. 使用腾讯云轻量应用服务器搭建网络质量拨测工具 SmokePing
  4. 拼多多——多多的字符变换
  5. 尚硅谷todolist案例
  6. 2018广告屏蔽软件
  7. 智能汽车里究竟“藏”有多少传感器?
  8. 排序算法系列之(二)——冒泡排序名字最为形象的一个
  9. python有什么特点有什么应用方向_你知道吗?python特点+可以做什么+就业前景(附30G学习资料)...
  10. Gantt(甘特图)与PERT(项目计划评审技术)图