如何查询clang ++的默认包含路径? [英] How to query the default include paths of clang++?

查看:1434
本文介绍了如何查询clang ++的默认包含路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查询clang / clang ++的默认包含路径?我尝试使用自定义的clang编译器(支持OpenMP的编译器),但是似乎找不到STL库:

How can I query the default include path of clang/clang++? I am trying to use a custom built clang compiler (the one that supports OpenMP), but it doesn't seem to find the STL libraries:

/usr/local/bin/clang++ hello.cpp 
hello.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
     ^
1 error generated.

通过使用IDE,回溯#include iostream,最后使用- isystem 选项,我得到了一个简单的helloworld应用程序,可以在OSX 10.9中进行编译:

By using an IDE, back-tracking the #include iostream, and finally using the -isystem option I got the simple helloworld application to compile in OSX 10.9:

/usr/local/bin/clang++ -isystem /Library/Developer/CommandLineTools/usr/lib/c++/v1 hello.cpp

感谢您的帮助!

推荐答案

您正在寻找选项 -v 。使用 clang ++ -c file.cc -v 进行编译将显示以下内容:

You are looking for option -v. Compiling with clang++ -c file.cc -v will print among other things:

#include "..." search starts here:
#include <...> search starts here:
 /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9

等。

这篇关于如何查询clang ++的默认包含路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆