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 libcxxabicd ../..
- 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 ...
随机推荐
- 爬虫框架--webmagic
官方有详细的使用文档:http://webmagic.io/docs/zh/ 简介:这只是个java爬虫框架,具体使用需要个人去定制,没有图片验证,不能获取js渲染的网页,但简单易用,可以通过xpat ...
- supervisor监管进程max file descriptor配置不生效的问题
配置了 sudo vim /etc/security/limits.conf * soft nofile * hard nofile 单独起进程没问题, 放到supervisor下监管启动,则报错 ...
- 在Python中使用可变长参数列表
函数定义 在函数定义中使用*args和**kwargs传递可变长参数. *args用作传递非命名键值可变长参数列表(位置参数); **kwargs用作传递键值可变长参数列表 函数调用 在调用函数时,使 ...
- Clean Old Kernels on CentOS
1. Check Installed Kernels $ rpm -q kernel 2. Clean Old Kernels ## need Install yum-utils ## ## Pack ...
- ThinkPhp 3.2 数据的连贯操作
ThinkPHP模型基础类提供的连贯操作方法(也有些框架称之为链式操作),可以有效的提高数据存取的代码清晰度和开发效率,并且支持所有的CURD操作. 使用也比较简单, 假如我们现在要查询一个User表 ...
- python中使用heapq查看最大与最小的N个元素列表
怎么从一个集合中获取最大或最小的N个元素列表? heapq模块有两个函数:nlargest() 和 nsmallest() 可以完美解决这个问题. In [39]: import heapq In [ ...
- Spring-----定时任务Quartz配置之手动设置
一 配置xml如下: <!-- 定时任务配置 --> <bean id="scheduler" class="org.springframework.s ...
- This month Calendar
package fourth;import java.text.DateFormatSymbols;import java.util.*;public class CalendarTest { pub ...
- Java直接内存与堆内存
NIO的Buffer提供了一个可以不经过JVM内存直接访问系统物理内存的类——DirectBuffer. DirectBuffer类继承自ByteBuffer,但和普通的ByteBuffer不同,普通 ...
- [UML]UML系列——时序图(顺序图)sequence diagram
系列文章 [UML]UML系列——用例图Use Case [UML]UML系列——用例图中的各种关系(include.extend) [UML]UML系列——类图Class [UML]UML系列——类 ...