C++ 未找到用于clang+++;OpenMP&x2B;stdlibc++;
我遵循了关于如何使用OpenMP支持Mac OS X编译clang(++)的出色演练。但是,在编译简单的测试程序时:C++ 未找到用于clang+++;OpenMP&x2B;stdlibc++;,c++,macos,clang,openmp,std,C++,Macos,Clang,Openmp,Std,我遵循了关于如何使用OpenMP支持Mac OS X编译clang(++)的出色演练。但是,在编译简单的测试程序时: #include <iostream> int main(int argc, char** argv) { std::cout << "Hello world!" << std::endl; return 0; } …它仍然不起作用。还有其他人遇到过这种情况并找到了解决方案吗?谢谢。好的,您可以包括包含iostream的目录
#include <iostream>
int main(int argc, char** argv)
{
std::cout << "Hello world!" << std::endl;
return 0;
}
…它仍然不起作用。还有其他人遇到过这种情况并找到了解决方案吗?谢谢。好的,您可以包括包含iostream的目录 clang2++-std=c++11-stdlib=libc++-fopenmp-o openmp openmp.cpp-I/usr/include
如果/usr/include包含iostream文件,我已通过在Clang/OpenMP构建过程中添加缺少的步骤成功编译了clib++ 在Clang/OpenMP页面()上,它要求您下载以下内容:-
$ git clone https://github.com/clang-omp/llvm
$ git clone https://github.com/clang-omp/compiler-rt llvm/projects/compiler-rt
$ git clone -b clang-omp https://github.com/clang-omp/clang llvm/tools/clang
如果要包括c++11支持,还应下载:-
$git clone llvm/projects/libcxx
其中一个构建参数是LLVM_EXTERNAL_LIBCXX_SOURCE_DIR(在cmakcache.txt中定义),它期望LIBCXX位于此位置
*注意。我不得不对Kyle Halladays OSX Mavericks说明中提到的构建说明进行轻微修改,替换为:
../configure--启用优化
具有
../configure--enable optimized CC=/usr/bin/clang CXX=/usr/bin/clang++在gcc中,我们使用-L隐式指定库目录。谢谢。include文件似乎位于/usr/include/c++。没关系,在完成与您的工作之前,请尝试告诉我
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
$ git clone https://github.com/clang-omp/llvm
$ git clone https://github.com/clang-omp/compiler-rt llvm/projects/compiler-rt
$ git clone -b clang-omp https://github.com/clang-omp/clang llvm/tools/clang