Clang与libc++abi库安装
系统ubuntu64位 Clang4.0
参考:
1 https://github.com/yangyangwithgnu/use_vim_as_ide#0.1
其中 第7章 工具链集成
2. http://clang.llvm.org/get_started.html
其中 Release Clang Versions
3. http://libcxxabi.llvm.org/
其中 Get it and get involved!
先开始进行按照1中的方式单独编译 Clang/llvm以及相应的库,在单独编译 libcxx以及libcxxabi库,其中libcxxabi 编译时报错 :clang-4.0 link error
3中提出libcxx以及libcxxabi库可以集成或单独编译,于是在2中直接将libcxxabi库直接包含在llvm/projects里面,最后集成编译整个项目。
最后用Clang++ 编译后一下文件。
编译源文件如下:
//new_feature.cpp
#include <iostream>
#include <string> class MyClass
{
public:
std::string s ="Hello, world\n"; // Non-static data member initializer
}; int main()
{
std::cout << MyClass().s;
}
编译命令如下
clang++ -std=c++11 -stdlib=libc++ -Werror -Weverything -Wno-disabled-macro-expansion -Wno-float-equal -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-global-constructors -Wno-exit-time-destructors -Wno-missing-prototypes -Wno-padded -Wno-old-style-cast -lc++ -lc++abi new_feature.cpp
得出的a.out文件出现
./a.out: error while loading shared libraries: libc++abi.so.1: cannot open shared object file: No such file or directory
最后在编译文件里面将一下几个库添加至/usr/lib 里面后得出输出。
库文件分别是:
libc++abi.so libc++abi.so.1 libc++abi.so.1.0
libc++.so.1 libc++.so.1.0 libc++.so
注意:可能需要将 build后生成的include里面的头文件手动拷贝到 /usr/include/c++/v1/ 里面,为了libc++以及libc++abi 的头文件在查找目录。
具体的命令如下:
- Get the required tools.
- See Getting Started with the LLVM System - Requirements.
- Note also that Python is needed for running the test suite. Get it at: http://www.python.org/download
- Standard build process uses CMake. Get it at: http://www.cmake.org/download
- Check out LLVM:
- Change directory to where you want the llvm directory placed.
- svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
- Check out Clang:
- cd llvm/tools
- svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
- cd ../..
- Check out extra Clang tools: (optional)
- cd llvm/tools/clang/tools
- svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
- cd ../../../..
- Check out Compiler-RT (optional):
- cd llvm/projects
- svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
- cd ../..
- Check out libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise)
- cd llvm/projects
- svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk libcxxabi
cd ../..
- Build LLVM and Clang:
- mkdir build (in-tree build is not supported)
- cd build
- cmake -G "Unix Makefiles" ../llvm
- make
- This builds both LLVM and Clang for debug mode.
- Note: For subsequent Clang development, you can just run make clang.
- CMake allows you to generate project files for several IDEs: Xcode, Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3. For more details see Building LLVM with CMake page.
Clang与libc++abi库安装的更多相关文章
- CentOS 6.4 编译安装LLVM3.3,Clang和Libc++
LLVM的最新版本3.3终于在6月17日发布了,按之前的计划6月5日就应该发布了,不过毕竟没有太晚,赶在VS2013 preview(6月26日微软Build大会)之前出来了.加上之前gcc4.8.1 ...
- CentOS7编译安装libc++和libc++abi
本文介绍了如何在CentOS 7中构建C++11构建环境 Clang的定制C++库是libc++(libcxx).然后,libcxx还需要一个ABI库,libc++abi(libcxxabi).不幸的 ...
- iOS - libc++abi.dylib: terminate_handler unexpectedly threw an exception
代码出现crash,报错:libc++abi.dylib: terminate_handler unexpectedly threw an exception 当我们很明确是某一块代码执行导致了错误, ...
- libc++abi.dylib: terminate_handler unexpectedly threw an exception错误小结
说法一: 我们在运行xcode工程时,有时候会遇到”libc++abi.dylib: terminate_handler unexpectedly threw an exception”错误,app莫 ...
- 综合出现NSScanner: nil string argument libc++abi.dylib: terminat错误的解决方案
在开发中出现了这个错误,断点查找很久,没找到问题所在的代码,google下,发现了下面这几点会产生这个错误: 首先,顾名思义,错误原因是我们在调用某个方法的时候,传入了一个空字符串(注意区别于字符串内 ...
- protocol buffer c++ python库安装
c++库安装较简单,不要用源码,还得下载依赖,就被墙了 https://github.com/google/protobuf/releases 下载一个最新的release安装 #protoc -- ...
- [转]Snappy压缩库安装和使用之一
Snappy压缩库安装和使用之一 原文地址:http://blog.csdn.net/luo6620378xu/article/details/8521223 近日需要在毕业设计中引入一个压缩库,要求 ...
- phpize 扩展GD库 安装 ! 环境--centos 7 +nginx 1.7.11+php 5.6.7
使用phpize编译GD库安装,先安装前置库libjpeg libpng zlib freetype等 都是下面php编译的几个选项 先看php编译的选项: --with-gd=DIR ...
- DCMTK3.6.1(MD支持库)安装说明
转载:http://qimo601.iteye.com/blog/1685135 [前言] 最近,因为需要开发DICOM网管模块,必须使用DCMTK的DcmNet模块.但是DCMTK3.6.0在Dcm ...
随机推荐
- 自己封装的常用NPOI文件导出源码
示例: 1. 2.示例2 源码下载地址:https://github.com/aa1356889/NPOICode
- 生成GUID唯一值的方法汇总(dotnet/javascript/sqlserver)
一.在 .NET 中生成1.直接用.NET Framework 提供的 Guid() 函数,此种方法使用非常广泛.GUID(全局统一标识符)是指在一台机器上生成的数字,它保证对在同一时空中的任何两台计 ...
- Picture intermediate frame ----- increase smooth
By YutaiHou
- 基于Dubbo框架构建分布式服务(二)
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> ...
- SHELL编写NGINX服务控制脚本
使用源码包安装的Nginx没办法使用"service nginx start"或"/etc/init.d/nginx start"进行操作和控制,所以写了以下的 ...
- JMeter 问题
1. JMeter 测试计划 测试计划 使用 JMeter 进行测试的起点,是其它 JMeter 测试元件的容器. 线程组 代表一定数量的并发用户,它可以用来模拟并发用户发送请求.实际的请求内容在S ...
- strrchr 一个获取扩展名的方便的php函数
上传文件时,$_FILES里面的name是稳健的名称,要获取扩展名就用 strrchr(str,符号)来截取最后一个.后面的扩展名 然后用 trim 去掉特殊字符. 就可以得到扩展名了
- ubuntu右上角时间不显示
重启unity sudo killall unity-panel-service
- zen Code 支持的代码样式
这里是一个支持的属性和操作符的列表: E 元素名称(div, p); E#id 使用id的元素(div#content, p#intro, span#error); E.class 使用类的元素(di ...
- Xcode 快捷键、常用技巧
关于iOS开发中的技能快捷键 经常使用鼠标太TM的D疼了,快捷键能大大地提高我们的开发速度,使我们的手指尽情的在键盘上飞舞,优美的代码,哈哈哈,那些常规的复制.粘贴.剪切请自行度娘或者Google一下 ...