当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 7 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : ubuntu安装clang
帖子发表于 : 2016-06-23 19:10 

注册: 2016-06-23 19:02
帖子: 4
送出感谢: 1
接收感谢: 0 次
本人是初学者,虽然在clang的官网上有getting start,但是觉得好麻烦,就尝试了以下方法:
1.直接apt-get,失败;
2.在ubuntu software里找,没有;
3.在packages.ubuntu.com里找,这下找到了,下载了一个amd64的deb包,安装成功。

请问一下这种方法会不会是不完整安装啊。


页首
 用户资料  
 
2 楼 
 文章标题 : Re: ubuntu安装clang
帖子发表于 : 2016-06-23 19:29 
头像

注册: 2011-03-20 13:12
帖子: 4521
地址: 山东省寿光县
系统: Debian
送出感谢: 105
接收感谢: 997
蓝芝熊 写道:
1.直接apt-get,失败;
3.在packages.ubuntu.com里找,这下找到了,下载了一个amd64的deb包,安装成功。

说明你的 sources.list 配置不正确
例如 未正确开启 universe 区

执行以下指令将结果全部复制贴上来
代码:
dpkg -l | grep clang
cat /etc/os-release
cat /etc/apt/sources.list


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户


页首
 用户资料  
 
3 楼 
 文章标题 : Re: ubuntu安装clang
帖子发表于 : 2016-06-23 20:03 

注册: 2016-06-23 19:02
帖子: 4
送出感谢: 1
接收感谢: 0 次
vickycq 写道:
蓝芝熊 写道:
1.直接apt-get,失败;
3.在packages.ubuntu.com里找,这下找到了,下载了一个amd64的deb包,安装成功。

说明你的 sources.list 配置不正确
例如 未正确开启 universe 区

执行以下指令将结果全部复制贴上来
代码:
dpkg -l | grep clang
cat /etc/os-release
cat /etc/apt/sources.list


dpkg -l | grep clang
ii clang 1:3.8-33ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii clang-3.8 1:3.8-2ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii libclang-common-3.8-dev 1:3.8-2ubuntu3 amd64 clang library - Common development package
ii libclang1-3.6:amd64 1:3.6.2-3ubuntu2 amd64 C interface to the clang library
ii libclang1-3.8:amd64 1:3.8-2ubuntu3 amd64 C interface to the clang library

cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial

cat /etc/apt/sources.list
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted

deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe

deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

sources.list里的一些注释我没贴出来,不影响吧


页首
 用户资料  
 
4 楼 
 文章标题 : Re: ubuntu安装clang
帖子发表于 : 2016-06-23 20:27 
头像

注册: 2011-03-20 13:12
帖子: 4521
地址: 山东省寿光县
系统: Debian
送出感谢: 105
接收感谢: 997
蓝芝熊 写道:
vickycq 写道:
说明你的 sources.list 配置不正确

直接apt-get,失败;
ii clang 1:3.8-33ubuntu3 amd64
VERSION="16.04 LTS (Xenial Xerus)"
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe

前面忘了问你 “直接apt-get,失败;”如何失败?
sources.list 配置正确
可能原因 未未执行 apt update
执行一次 apt update 再 apt search clang
看看 是否正确返回结果?

蓝芝熊 写道:
请问一下这种方法会不会是不完整安装啊。
ii clang 1:3.8-33ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii clang-3.8 1:3.8-2ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii libclang-common-3.8-dev 1:3.8-2ubuntu3 amd64 clang library - Common development package
ii libclang1-3.6:amd64 1:3.6.2-3ubuntu2 amd64 C interface to the clang library
ii libclang1-3.8:amd64 1:3.8-2ubuntu3 amd64 C interface to the clang library

应该没问题 依赖都有了


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户



_________________
评价: 3.7% 蓝芝熊
 
页首
 用户资料  
 
5 楼 
 文章标题 : Re: ubuntu安装clang
帖子发表于 : 2016-06-23 20:45 

注册: 2016-06-23 19:02
帖子: 4
送出感谢: 1
接收感谢: 0 次
vickycq 写道:
蓝芝熊 写道:
vickycq 写道:
说明你的 sources.list 配置不正确

直接apt-get,失败;
ii clang 1:3.8-33ubuntu3 amd64
VERSION="16.04 LTS (Xenial Xerus)"
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe

前面忘了问你 “直接apt-get,失败;”如何失败?
sources.list 配置正确
可能原因 未未执行 apt update
执行一次 apt update 再 apt search clang
看看 是否正确返回结果?

蓝芝熊 写道:
请问一下这种方法会不会是不完整安装啊。
ii clang 1:3.8-33ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii clang-3.8 1:3.8-2ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii libclang-common-3.8-dev 1:3.8-2ubuntu3 amd64 clang library - Common development package
ii libclang1-3.6:amd64 1:3.6.2-3ubuntu2 amd64 C interface to the clang library
ii libclang1-3.8:amd64 1:3.8-2ubuntu3 amd64 C interface to the clang library

应该没问题 依赖都有了


之前给出的信息忘记了 :em06 。已经update了,search也能返回结果。非常感谢


页首
 用户资料  
 
6 楼 
 文章标题 : Re: ubuntu安装clang
帖子发表于 : 2016-06-23 21:07 

注册: 2016-06-23 19:02
帖子: 4
送出感谢: 1
接收感谢: 0 次
vickycq 写道:
蓝芝熊 写道:
vickycq 写道:
说明你的 sources.list 配置不正确

直接apt-get,失败;
ii clang 1:3.8-33ubuntu3 amd64
VERSION="16.04 LTS (Xenial Xerus)"
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe

前面忘了问你 “直接apt-get,失败;”如何失败?
sources.list 配置正确
可能原因 未未执行 apt update
执行一次 apt update 再 apt search clang
看看 是否正确返回结果?

蓝芝熊 写道:
请问一下这种方法会不会是不完整安装啊。
ii clang 1:3.8-33ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii clang-3.8 1:3.8-2ubuntu3 amd64 C, C++ and Objective-C compiler (LLVM based)
ii libclang-common-3.8-dev 1:3.8-2ubuntu3 amd64 clang library - Common development package
ii libclang1-3.6:amd64 1:3.6.2-3ubuntu2 amd64 C interface to the clang library
ii libclang1-3.8:amd64 1:3.8-2ubuntu3 amd64 C interface to the clang library

应该没问题 依赖都有了


对了,刚刚用dpkg查看了一下gcc,发现ubuntu16.04已经安装了gcc6.0,该怎么使用它呢,默认调用的是gcc5.3.1


页首
 用户资料  
 
7 楼 
 文章标题 : Re: ubuntu安装clang
帖子发表于 : 2016-07-05 19:18 

注册: 2016-04-21 20:37
帖子: 37
系统: win10
送出感谢: 2
接收感谢: 0 次
只编译安卓时用源码自带的clang,所以就不说了


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 7 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:Google [Bot] 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译